JP6031801B2 - Performance device, method and program - Google Patents

Performance device, method and program Download PDF

Info

Publication number
JP6031801B2
JP6031801B2 JP2012084373A JP2012084373A JP6031801B2 JP 6031801 B2 JP6031801 B2 JP 6031801B2 JP 2012084373 A JP2012084373 A JP 2012084373A JP 2012084373 A JP2012084373 A JP 2012084373A JP 6031801 B2 JP6031801 B2 JP 6031801B2
Authority
JP
Japan
Prior art keywords
angular velocity
acceleration
cpu
holding member
sensor
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.)
Active
Application number
JP2012084373A
Other languages
Japanese (ja)
Other versions
JP2013213948A (en
JP2013213948A5 (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2012084373A priority Critical patent/JP6031801B2/en
Publication of JP2013213948A publication Critical patent/JP2013213948A/en
Publication of JP2013213948A5 publication Critical patent/JP2013213948A5/ja
Application granted granted Critical
Publication of JP6031801B2 publication Critical patent/JP6031801B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、演奏装置、方法及びプログラムに関する。   The present invention relates to a performance device, a method, and a program.

従来、演奏者の演奏動作を検知すると、演奏動作に応じた音を発音する演奏装置が提案されている。例えば、スティック状の部材のみからなる構成で打楽器音を発音する演奏装置が知られており、この演奏装置では、スティック状の部材にセンサが設けられ、演奏者が、部材を手で保持して振ることで、センサがその演奏動作を検知して、打楽器音を発音する。
このような仮想的な演奏装置によれば、現実の楽器を必要とせずに当該楽器の楽音を発音することができるため、演奏者は、演奏場所や演奏スペースに制約を受けずに演奏を楽しむことができる。
2. Description of the Related Art Conventionally, there has been proposed a performance device that generates a sound corresponding to a performance operation when the performance operation of the performer is detected. For example, a performance device that produces percussion instrument sounds with only a stick-shaped member is known. In this performance device, a sensor is provided on the stick-shaped member, and the player holds the member by hand. By shaking, the sensor detects the performance and produces a percussion instrument sound.
According to such a virtual performance device, the musical sound of the musical instrument can be generated without the need for an actual musical instrument, so that the performer can enjoy the performance without being restricted by the performance place or performance space. be able to.

上述のような仮想的演奏装置として、例えば、特許文献1には、スティック状の部材に加速度センサを設け、この部材を振ることにより加速度センサから得られる出力(加速度値)が所定の閾値に達した後、楽音を発音するように構成された演奏装置が開示されている。   As a virtual performance device as described above, for example, in Patent Document 1, an acceleration sensor is provided on a stick-shaped member, and an output (acceleration value) obtained from the acceleration sensor by shaking this member reaches a predetermined threshold value. Then, a performance device configured to generate a musical tone is disclosed.

特開2007−256736号公報JP 2007-256736 A

しかしながら、特許文献1では、発音する際の音量の決定についての記載はなく、特許文献1の発明をそのまま適用するならば、加速度の大きさに応じて音量を決定しなければならない。ところが、ショットの強さは減速方向の加速度に応じて決定されるが、速度は、加速度を積分して求めるため、加速度に誤差が生じると誤差を積分することになり、スティックが動きっぱなしになると、速度の精度が著しく悪化してしまい、減速と加速の区別がつかなくなる。   However, in Patent Document 1, there is no description of determining the sound volume when sounding, and if the invention of Patent Document 1 is applied as it is, the sound volume must be determined according to the magnitude of acceleration. However, the shot strength is determined according to the acceleration in the deceleration direction, but the speed is obtained by integrating the acceleration, so if an error occurs in the acceleration, the error is integrated, and the stick keeps moving. As a result, the accuracy of the speed is remarkably deteriorated, and it becomes impossible to distinguish between deceleration and acceleration.

そのため、仮想的な音源を仮想的な水平面上にのみ配置する制約を設け、重力方向と逆方向が減速方向であるので、その方向の加速度成分からスティックの発音量を決定する方法が提案されている。しかし、この方法では、仮想的な音源が仮想空間内に垂直に配置されている場合は応用できない問題があった。   For this reason, there is a restriction to place a virtual sound source only on a virtual horizontal plane, and since the direction opposite to the direction of gravity is the deceleration direction, a method has been proposed for determining the amount of sound produced by the stick from the acceleration component in that direction. Yes. However, this method has a problem that it cannot be applied when virtual sound sources are arranged vertically in a virtual space.

本発明は、このような状況に鑑みてなされたものであり、仮想的な音源が仮想空間内に垂直に配置されている場合であっても、スイング動作の強さを反映して適切な音量制御が可能な演奏装置を提供することを目的とする。   The present invention has been made in view of such a situation, and even when a virtual sound source is arranged vertically in a virtual space, an appropriate volume that reflects the strength of the swing motion is reflected. An object is to provide a performance device that can be controlled.

上記目的を達成するため、本発明の一態様の演奏装置は、
ユーザが保持可能な保持部材と、
前記保持部材の互いに直交する3軸それぞれの方向に生じる加速度を検出する加速度センサと、
前記直交する3軸それぞれを中心として回転した場合に生じる角速度を検出する角速度センサと、
前記角速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる角速度に基づいて、演奏操作中の前記保持部材の角速度の最大値を取得する第1取得手段と、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の加速度の最大値を取得する第2取得手段と、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の速度の最大値を取得する第3取得手段と、
前記第1取得手段により取得された前記角速度の最大値と、前記第2取得手段により取得された前記加速度の最大値と、前記第3取得手段により取得された前記速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御手段と、を備える、
ことを特徴とする。
In order to achieve the above object, a performance device according to one aspect of the present invention includes:
A holding member that can be held by the user;
An acceleration sensor that detects acceleration generated in the directions of the three axes perpendicular to each other of the holding member;
An angular velocity sensor that detects an angular velocity that occurs when rotating about each of the three orthogonal axes;
First acquisition means for acquiring a maximum value of the angular velocity of the holding member during a performance operation based on an angular velocity generated corresponding to the swing-down operation of the holding member detected by the angular velocity sensor;
Second acquisition means for acquiring a maximum acceleration value of the holding member based on an acceleration generated in response to a swing-down operation of the holding member detected by the acceleration sensor;
Third acquisition means for acquiring a maximum value of the speed of the holding member based on acceleration generated in response to the swing-down operation of the holding member detected by the acceleration sensor;
Based on the maximum value of the angular velocity acquired by the first acquisition unit, the maximum value of the acceleration acquired by the second acquisition unit, and the maximum value of the velocity acquired by the third acquisition unit. Volume control means for controlling the volume of the musical sound to be generated,
It is characterized by that.

本発明によれば、仮想的な音源が仮想空間内に垂直に配置されている場合であっても、スイング動作の強さを反映して適切な音量制御が可能となる。   According to the present invention, even when a virtual sound source is arranged vertically in the virtual space, appropriate volume control is possible reflecting the strength of the swing motion.

本発明の演奏装置の一実施形態の概要を示す図である。It is a figure which shows the outline | summary of one Embodiment of the performance apparatus of this invention. 上記演奏装置のスティック部の構成を示すブロック図である。It is a block diagram which shows the structure of the stick part of the said performance apparatus. 上記演奏装置の発音部の構成を示すブロック図である。It is a block diagram which shows the structure of the sound generation part of the said performance apparatus. 上記演奏装置のスティック部についての詳細を説明する図である。It is a figure explaining the detail about the stick part of the said performance apparatus. 本発明の演奏装置の一実施形態に係るワールド座標系について説明する図である。It is a figure explaining the world coordinate system which concerns on one Embodiment of the performance apparatus of this invention. 上記スティック部のCPUが実行する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which CPU of the said stick part performs. 姿勢センサと姿勢の初期化処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an attitude | position sensor and an initialization process of an attitude | position. 姿勢推定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an attitude | position estimation process. 位置推定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a position estimation process. 先端動き予測処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a front-end | tip movement prediction process. 上記スティック部のスティック先端回転軸とスイング方向との関係を示す図である。It is a figure which shows the relationship between the stick tip rotating shaft of the said stick part, and a swing direction. 第1の実施例における発音タイミング検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the sound generation timing detection process in a 1st Example. 第2の実施例における発音タイミング検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the sound generation timing detection process in a 2nd Example. 上記スティック部の動作状態の遷移を示す図である。It is a figure which shows the transition of the operation state of the said stick part. 発音量検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a pronunciation | sound_production amount detection process. ノートイベント生成処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a note event production | generation process. 変形例におけるサウンド探索処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the sound search process in a modification. 発音処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a sound generation process.

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

以下、添付図面を参照して、本発明の実施形態について説明する。
図1は、本発明の一実施形態の演奏装置1の概要を示す図である。図1に示すように本発明の演奏装置1は、スティック部10と、発音部30とから構成される。
スティック部10は、長手方向に延びるスティック状の部材である。演奏者は、スティック部10の一端(根元側)を手に持ち手首などを中心とした振り上げ及び振り下ろし動作を行うことで、演奏動作を行う。このような演奏者の演奏動作を検知するため、スティック部10の他端(先端側)には、姿勢センサ12が設けられている(図2参照)。
Embodiments of the present invention will be described below with reference to the accompanying drawings.
FIG. 1 is a diagram showing an outline of a performance device 1 according to an embodiment of the present invention. As shown in FIG. 1, the performance device 1 of the present invention includes a stick unit 10 and a sound generation unit 30.
The stick part 10 is a stick-like member extending in the longitudinal direction. The performer performs a performance operation by holding up one end (base side) of the stick unit 10 and performing a swing-up and swing-down operation around the wrist or the like. In order to detect such a player's performance, a posture sensor 12 is provided at the other end (tip side) of the stick unit 10 (see FIG. 2).

発音部30は、楽音を発音する。
このような演奏装置1では、スティック部10を用いた演奏動作、すなわち、スティック部10の振り下ろし動作に応じて、発音部30は、所定の楽音を発音する。これにより、演奏者による演奏が行われる。
The sound generator 30 generates a musical sound.
In such a performance device 1, the sound generator 30 generates a predetermined musical sound in response to a performance operation using the stick unit 10, that is, a swing-down operation of the stick unit 10. Thereby, a performance by a performer is performed.

[演奏装置1の構成]
初めに、図2及び図3を参照して、本実施形態の演奏装置1の各構成要素、具体的には、スティック部10、及び発音部30の構成について説明する。
[Configuration of the performance device 1]
First, with reference to FIG.2 and FIG.3, each component of the performance apparatus 1 of this embodiment, specifically, the structure of the stick part 10 and the sound generation part 30, is demonstrated.

[スティック部10の構成]
図2は、スティック部10の構成を示すブロック図である。図2に示すように、スティック部10は、CPU(Central Processing Unit)11、姿勢センサ12、I/F(インタフェース)装置13、ROM(Read Only Memory)14、RAM(Random Access Memory)15、入力部16、無線通信装置17及びLED18から構成される。
姿勢センサ12は、地磁気方向を計測する3軸の磁気センサ121、スティックに加わる加速度を測定するための3軸の加速度センサ122、及びスティックの回転動作を計測する3軸の角速度センサ123から構成される。各センサは3つの軸x、y、zの軸方向の計測が可能になっている。
[Configuration of Stick Unit 10]
FIG. 2 is a block diagram showing the configuration of the stick unit 10. As shown in FIG. 2, the stick unit 10 includes a CPU (Central Processing Unit) 11, an attitude sensor 12, an I / F (interface) device 13, a ROM (Read Only Memory) 14, a RAM (Random Access Memory) 15, and an input. The unit 16 includes a wireless communication device 17 and an LED 18.
The posture sensor 12 includes a triaxial magnetic sensor 121 that measures the geomagnetic direction, a triaxial acceleration sensor 122 that measures acceleration applied to the stick, and a triaxial angular velocity sensor 123 that measures the rotational movement of the stick. The Each sensor can measure in the axial direction of three axes x, y, and z.

図4を参照して、本実施形態では、スティック部10の長手方向の軸と一致する軸をy軸とし、姿勢センサ12が配置された基板(図示せず)と平行で、かつ、y軸と直交する軸をx軸とし、x軸及びy軸と直交する軸をz軸としている。磁気センサ121は、地磁気ベクトルのx軸、y軸、z軸のそれぞれの成分の地磁気値を取得できる。また、加速度センサ122は、x軸、y軸、z軸のそれぞれの成分の加速度値を取得できる。また角速度センサ123は軸それぞれを中心とする角速度の成分の値(ωx、ωy、ωz)を取得できる。
ここで、演奏者は、スティック部10の一端(根元側)を保持し、手首などを中心とした振り上げ及び振り下ろし動作を行うことで、スティック部10に対して回転運動や平行運動などを生じさせる。これらの動きを姿勢センサ12で検出をおこない、CPU11に送り出す。
Referring to FIG. 4, in this embodiment, an axis that coincides with the longitudinal axis of the stick portion 10 is defined as a y-axis, parallel to a substrate (not shown) on which the attitude sensor 12 is disposed, and the y-axis. The axis orthogonal to the x axis is the x axis, and the axis orthogonal to the x axis and the y axis is the z axis. The magnetic sensor 121 can acquire the geomagnetic value of each component of the x-axis, y-axis, and z-axis of the geomagnetic vector. Further, the acceleration sensor 122 can acquire acceleration values of components of the x-axis, y-axis, and z-axis. Further, the angular velocity sensor 123 can acquire values (ωx, ωy, ωz) of angular velocity components centered on the respective axes.
Here, the performer holds one end (base side) of the stick unit 10 and performs a swing-up and swing-down operation around the wrist or the like, thereby causing a rotational motion or a parallel motion to the stick unit 10. Let These movements are detected by the attitude sensor 12 and sent to the CPU 11.

図2に戻り、CPU11は、姿勢センサ12が検出した加速度値、角速度値、地磁気方向と強度を読み出し、これらの値に応じて、スティックの姿勢、及び、発音のタイミング検出を行う。これにより、CPU11は、その発音に対応するノートオンイベントの生成を行い、I/F装置13及び無線通信装置17を介してノートオンイベントを発音部30に送信する。ここで、ノートオンイベントとは、楽音の発音を音源部371(図3参照)に対して指示するコマンド情報であり、本実施形態においては、発音する楽音の音色や音高の情報に加えて、さらに楽音の音量などの情報を含むものである。   Returning to FIG. 2, the CPU 11 reads the acceleration value, angular velocity value, geomagnetic direction and intensity detected by the posture sensor 12, and detects the posture of the stick and the timing of sound generation according to these values. Thereby, the CPU 11 generates a note-on event corresponding to the sound generation, and transmits the note-on event to the sound generation unit 30 via the I / F device 13 and the wireless communication device 17. Here, the note-on event is command information for instructing the tone generator 371 (see FIG. 3) to generate a musical tone, and in this embodiment, in addition to the tone color and pitch information of the musical tone to be generated. In addition, it includes information such as the sound volume.

このように、CPU11は、スティック部10が有する姿勢センサ12の各センサ値に基づいて発音部30にノートオンイベントを送信することで、発音部30は、スティック部10を用いた演奏動作に基づいて所定の楽音を発音することができる。   In this way, the CPU 11 transmits a note-on event to the sound generation unit 30 based on each sensor value of the posture sensor 12 included in the stick unit 10, so that the sound generation unit 30 is based on a performance operation using the stick unit 10. Can produce a predetermined tone.

ROM14は、CPU11が実行する各種処理の処理プログラム、すなわち、前述したように、姿勢センサ12によるデータの取得、ノートオンイベントの生成処理、ノートオンイベントの送信処理などの処理プログラムを格納する。RAM15は、姿勢センサ12の各センサ値、処理において取得され或いは生成された値を格納する。I/F13は、CPU11からの指示にしたがって無線通信装置17にデータを出力する。   The ROM 14 stores processing programs for various processes executed by the CPU 11, that is, processing programs such as data acquisition by the attitude sensor 12, note-on event generation processing, and note-on event transmission processing as described above. The RAM 15 stores each sensor value of the attitude sensor 12 and a value acquired or generated in the processing. The I / F 13 outputs data to the wireless communication device 17 in accordance with an instruction from the CPU 11.

また、入力部16は、各種スイッチ(図示せず)を有し、演奏者からの各種指示入力を受け付ける。   The input unit 16 has various switches (not shown) and receives various instruction inputs from the performer.

無線通信装置17は、発音部30との間で所定の無線通信を行う。所定の無線通信は、任意の方法で行うこととしてよく、本実施形態では、無線通信装置17は、赤外線通信により発音部30との間で無線通信を行う。LED18は、CPU11からの制御に応じて発光及び消灯する。なお、LED18は、スティックの姿勢の初期化などのスティックの処理状態を示すためなどに用いられる。   The wireless communication device 17 performs predetermined wireless communication with the sound generation unit 30. The predetermined wireless communication may be performed by an arbitrary method. In the present embodiment, the wireless communication device 17 performs wireless communication with the sound generation unit 30 by infrared communication. The LED 18 emits light and goes off according to control from the CPU 11. The LED 18 is used for indicating a processing state of the stick such as initialization of the stick posture.

[発音部30の構成] [Configuration of Sound Generation Unit 30]

次に、図3を参照して、発音部30の構成について説明する。図3は、発音部30の構成を示すブロック図である。図3に示すように、発音部30は、CPU31、I/F(インタフェース)32、ROM33、RAM34、表示部35、入力部36及びサウンドシステム37から構成される。発音部30のI/F32は、スティック部10からのデータ(例えば、楽音を発音する制御データであるノートオンイベント)を受け入れて、RAM34に格納するとともに、CPU31にデータの受け入れを通知する。本実施形態においては、スティック部10に無線通信装置17が、発音部30に赤外線通信装置38が設けられている。I/F32は、スティック部10の無線通信装置17が発した無線信号を、赤外線通信装置38で受信することで、スティック部10からデータを受信する。   Next, the configuration of the sound generation unit 30 will be described with reference to FIG. FIG. 3 is a block diagram illustrating a configuration of the sound generation unit 30. As shown in FIG. 3, the sound generation unit 30 includes a CPU 31, an I / F (interface) 32, a ROM 33, a RAM 34, a display unit 35, an input unit 36, and a sound system 37. The I / F 32 of the sound generation unit 30 receives data from the stick unit 10 (for example, a note-on event that is control data for generating a musical sound), stores the data in the RAM 34, and notifies the CPU 31 of the data reception. In the present embodiment, the stick unit 10 is provided with a wireless communication device 17, and the sound generation unit 30 is provided with an infrared communication device 38. The I / F 32 receives data from the stick unit 10 by receiving the wireless signal generated by the wireless communication device 17 of the stick unit 10 by the infrared communication device 38.

CPU31は、演奏装置1全体の制御、特に、発音部30の制御、入力部36を構成するキースイッチ(図示せず)の操作の検出、I/F32を介して受信したスティック部10からのノートオンイベントに基づく楽音の発音など、種々の処理を実行する。   The CPU 31 controls the performance device 1 as a whole, in particular, controls the sound generator 30, detects operations of key switches (not shown) constituting the input unit 36, and notes from the stick unit 10 received via the I / F 32. Various processing such as sound generation based on on-event is executed.

ROM33は、演奏装置1全体の制御、特に、発音部30の制御、入力部36を構成するキースイッチ(図示せず)の操作の検出、I/F32を介して受信したノートオンイベントに基づく楽音の発音など、種々の処理プログラムを格納する。また、ROM33は、種々の音色の波形データ、例えば、フルート、サックス、トランペットなどの管楽器、ピアノなどの鍵盤楽器、ギターなどの弦楽器、バスドラム、ハイハット、スネア、シンバル、タムなど打楽器の波形データを格納する波形データエリアを含む。   The ROM 33 controls the performance device 1 as a whole, in particular, the sound generation unit 30, the detection of operation of a key switch (not shown) constituting the input unit 36, and a musical tone based on a note-on event received via the I / F 32. Stores various processing programs such as pronunciation. The ROM 33 stores waveform data of various timbres, for example, wind instruments such as flutes, saxophones, and trumpets, keyboard instruments such as pianos, stringed instruments such as guitars, bass drums, hi-hats, snares, cymbals, and toms. Includes waveform data area to store.

RAM34は、ROM33から読み出されたプログラムや、処理の過程で生じたデータやパラメータを記憶する。処理の過程で生じたデータには、入力部36のスイッチの操作状態、I/F32を介して受信したノートオンイベントや演奏者の身体動作の状態(前進フラグや変位量)などが含まれる。   The RAM 34 stores programs read from the ROM 33, data and parameters generated in the course of processing. The data generated in the process includes the operation state of the switch of the input unit 36, the note-on event received via the I / F 32, the state of the player's physical movement (forward flag and displacement), and the like.

表示部35は、例えば、液晶表示装置で構成され、選択された音色や音量、演奏者の身体動作の状態(基準位置からの変位量)などを画像として表示する。また、入力部36は、各種スイッチ(図示せず)を有し、演奏者からの各種情報の入力を受け付ける。   The display unit 35 is composed of, for example, a liquid crystal display device, and displays the selected tone color and volume, the state of the player's body movement (displacement from the reference position), and the like as an image. The input unit 36 has various switches (not shown) and accepts input of various information from the performer.

サウンドシステム37は、音源部371、オーディオ回路372及びスピーカ373を含む。音源部371は、CPU31からの指示にしたがって、ROM33の波形データエリアから波形データを読み出して、楽音データを生成して出力する。オーディオ回路372は、音源部371から出力された楽音データをアナログ信号に変換するとともに、変換したアナログ信号を増幅してスピーカ373に出力する。これによりスピーカ373から楽音が出力される。   The sound system 37 includes a sound source unit 371, an audio circuit 372, and a speaker 373. The sound source unit 371 reads out waveform data from the waveform data area of the ROM 33 in accordance with an instruction from the CPU 31, and generates and outputs musical sound data. The audio circuit 372 converts the musical sound data output from the sound source unit 371 into an analog signal, amplifies the converted analog signal, and outputs the amplified analog signal to the speaker 373. As a result, a musical tone is output from the speaker 373.

[座標系の説明]
次に本実施形態におけるスティックの姿勢、及びワールド座標系について図5を参照して説明する。ここでワールド座標とは、演奏者を中心とした座標系のことをいう。図5にあるように演奏者から見て右水平方向をX軸、前方水平方向をY軸、天頂方向をZ軸と定義する。図4で記載したスティック部10の3軸であるx軸、y軸、z軸とは異なる。本実施形態では、スティック部10の3軸を、ローカル座標系と呼び小文字で表すのに対して、ワールド座標系では3軸を大文字で表す。演奏者がスティック部10をスイングさせると時間とともにローカル座標とワールド座標との関係が変わっていく。ワールド座標系から見て、スティック部10のローカル座標系の向きがどのようになっているかをスティックの姿勢と呼ぶ。
[Description of coordinate system]
Next, the posture of the stick and the world coordinate system in this embodiment will be described with reference to FIG. Here, the world coordinate means a coordinate system centered on the performer. As shown in FIG. 5, the right horizontal direction as viewed from the performer is defined as the X axis, the front horizontal direction is defined as the Y axis, and the zenith direction is defined as the Z axis. This is different from the x-axis, y-axis, and z-axis, which are the three axes of the stick unit 10 described in FIG. In the present embodiment, the three axes of the stick unit 10 are referred to as a local coordinate system and expressed in lowercase letters, whereas in the world coordinate system, the three axes are expressed in uppercase letters. When the performer swings the stick unit 10, the relationship between the local coordinates and the world coordinates changes with time. The orientation of the local coordinate system of the stick unit 10 when viewed from the world coordinate system is referred to as the posture of the stick.

また、スティック部10が移動すると、ワールド座標系の原点からみたローカル座標系の原点も移動する。ワールド座標系から見たローカル座標系の原点をスティック部10の位置と呼ぶ。   When the stick unit 10 moves, the origin of the local coordinate system as viewed from the origin of the world coordinate system also moves. The origin of the local coordinate system viewed from the world coordinate system is called the position of the stick unit 10.

[演奏装置1の処理] [Processing of the performance device 1]

続いて、本実施形態の演奏装置1の処理について説明する。初めに、図6を参照しながらスティック部10において実行される処理について概要説明をする。   Next, processing of the performance device 1 according to this embodiment will be described. First, an outline of the processing executed in the stick unit 10 will be described with reference to FIG.

図6は、スティック部10のCPU11が実行する処理の流れを示すフローチャートである。CPU11は、ROM14からプログラムコードを読みだして実行する。   FIG. 6 is a flowchart showing a flow of processing executed by the CPU 11 of the stick unit 10. The CPU 11 reads the program code from the ROM 14 and executes it.

まず、CPU11は、姿勢センサ12が有する各種センサの初期化とRAM15のデータのクリアなどを含むイニシャライズ処理を実行する(ステップS11)。イニシャライズ処理が終了すると、CPU11は、姿勢センサ12が有する各種センサのもつデバイスのばらつきや温度によって変化するオフセットやゲイン調整などを実行する(ステップS12)。次に、CPU11は、入力部36のスイッチの状態を読み出してRAM15に保存する(ステップS14)。RAM15に保存された当該スイッチの状態は、後述する位置検出の補助などに用いられる。   First, the CPU 11 executes initialization processing including initialization of various sensors included in the attitude sensor 12 and clearing of data in the RAM 15 (step S11). When the initialization process is completed, the CPU 11 executes offset and gain adjustments that vary depending on device variations and temperatures of various sensors included in the attitude sensor 12 (step S12). Next, the CPU 11 reads the switch state of the input unit 36 and stores it in the RAM 15 (step S14). The state of the switch stored in the RAM 15 is used for assisting position detection, which will be described later.

次に、CPU11は、ユーザがスティック部10をスイングしたとき、そのスイングに応じて発音させる処理を実行する(ステップS16〜S24))。まず、CPU11は、姿勢センサ12の加速度値、角速度値、及び地磁気の方向と強度をRAM15に保存する(ステップS16)。   Next, when the user swings the stick unit 10, the CPU 11 executes a process of generating a sound according to the swing (steps S16 to S24). First, the CPU 11 stores the acceleration value, angular velocity value, and geomagnetic direction and intensity of the attitude sensor 12 in the RAM 15 (step S16).

CPU11は、この読みだした値に応じてスティック部10の姿勢の推定を実行し(ステップS17)、次に、スティック部10の平行移動の位置推定を実行する(ステップS18)。さらに、CPU11は、スティック部10の先端の動き予測を実行し(ステップS19)、この予測された動きを用いて、発音タイミングの検出を実行する(ステップS20)。さらに、CPU11は、発音量の検出を実行する(ステップS21)。ステップS20において発音タイミングである(動作状態が後述する「SHOT」である)場合(ステップS22でYESと判定された場合)、CPU11は、スティック部10の姿勢及び位置に応じて楽音の音色や音高を決定してノートオンイベントを生成し(ステップS23)、生成されたノートオンイベントを発音部30に送信する(ステップS24)。   The CPU 11 executes the estimation of the posture of the stick unit 10 according to the read value (step S17), and then executes the position estimation of the parallel movement of the stick unit 10 (step S18). Further, the CPU 11 performs motion prediction of the tip of the stick unit 10 (step S19), and executes sound generation timing detection using the predicted motion (step S20). Further, the CPU 11 detects the sound generation amount (step S21). If it is the sound generation timing in step S20 (the operation state is “SHOT” to be described later) (if YES is determined in step S22), the CPU 11 determines the tone and tone of the musical tone according to the posture and position of the stick unit 10. The note-on event is generated by determining the height (step S23), and the generated note-on event is transmitted to the sound generator 30 (step S24).

[姿勢センサと姿勢の初期化]
図7を参照して、図6のステップS12の姿勢センサと姿勢の初期化処理の詳細説明を行う。
[Attitude sensor and initialization of attitude]
With reference to FIG. 7, the posture sensor and the posture initialization process in step S12 of FIG. 6 will be described in detail.

図7は、姿勢センサと姿勢の初期化処理の流れを示すフローチャートである。
まず、CPU11は、ユーザにスティック部10の先端を前方方向に向けて静止してもらうように表示を行う(ステップS71)。表示の例としては、CPU11は、LED18を緑色に点灯させる。
FIG. 7 is a flowchart showing the flow of the posture sensor and posture initialization processing.
First, the CPU 11 performs display so that the user has the tip of the stick unit 10 pointed forward and stops (step S71). As an example of display, the CPU 11 turns on the LED 18 in green.

次に、CPU11は、角速度センサ123の各軸のデータを読み出す。角速度センサ123は通常、デバイスのばらつきや温度変動により、角速度0であるときのオフセット値が変動する。CPU11は、角速度センサ123の値をオフセット値としてRAM15に記憶する(ステップS72)。以降のステップでは、CPU11は、角速度センサ123の値を読み出したとき、読み出した値からこのオフセット値を引くことで、スティック部10が静止しているときの角速度が0となるように調整する。   Next, the CPU 11 reads data of each axis of the angular velocity sensor 123. The angular velocity sensor 123 usually varies in offset value when the angular velocity is zero due to device variations and temperature variations. The CPU 11 stores the value of the angular velocity sensor 123 as an offset value in the RAM 15 (step S72). In subsequent steps, when the value of the angular velocity sensor 123 is read, the CPU 11 subtracts this offset value from the read value so that the angular velocity when the stick unit 10 is stationary is adjusted to zero.

次に、CPU11は、加速度センサ122の各軸のデータを読み出して、前回の加速度と比較し重力方向の変化を検出したか否かを判断する(ステップS74)。具体的には、スティック部10の静止状態では、加速度センサ122の値は重力方向の各軸成分のみを示すことになるので、CPU11は、各軸成分の値に変化がない場合に、スティックが静止状態であることを検出できる。本実施形態では、CPU11は、1秒程度変化がない場合に、スティックが静止状態であることを検出する。CPU11は、スティックが静止状態であることを検出した場合には、角速度のオフセット値の登録を完了して、ステップS75に処理を移す。一方、CPU11は、スティックが動作したことを検出した場合、ステップS72に処理を移し、再度オフセット値の登録をやり直す。   Next, the CPU 11 reads the data of each axis of the acceleration sensor 122 and determines whether or not a change in the direction of gravity is detected compared with the previous acceleration (step S74). Specifically, when the stick unit 10 is in a stationary state, the value of the acceleration sensor 122 indicates only each axis component in the gravitational direction. Therefore, the CPU 11 determines that the stick does not change when the value of each axis component does not change. It can be detected that it is stationary. In the present embodiment, the CPU 11 detects that the stick is stationary when there is no change for about 1 second. If the CPU 11 detects that the stick is stationary, the CPU 11 completes registration of the offset value of the angular velocity and moves the process to step S75. On the other hand, if the CPU 11 detects that the stick has been operated, the process proceeds to step S72 and the offset value is registered again.

続いて、CPU11は、姿勢の初期化を行う(ステップS75)。具体的には、CPU11は、ユーザが前方方向にスティック部10の先端部を向けた状態で、スティック部10の先端部が向いている方向が、ワールド座標系の前方(Y軸方向)になるようにワールド座標系とローカル座標系の関係を初期化する。また、CPU11は、当該初期化時点における角速度、加速度及び地磁気の各軸成分をRAM15に記憶する。   Subsequently, the CPU 11 initializes the posture (step S75). Specifically, the CPU 11 has the direction in which the tip of the stick unit 10 faces in the state where the user points the tip of the stick unit 10 in the forward direction, which is the front of the world coordinate system (Y-axis direction). Initialize the relationship between the world coordinate system and the local coordinate system. In addition, the CPU 11 stores the angular velocity, acceleration, and geomagnetism axis components at the time of initialization in the RAM 15.

続いて、CPU11は、ユーザにスティック部10を様々な方向に向ける動作をさせるための表示を行う(ステップS76)。例えば、CPU11は、LED18を赤色で点滅させる。   Subsequently, the CPU 11 performs display for causing the user to move the stick unit 10 in various directions (step S76). For example, the CPU 11 blinks the LED 18 in red.

さらに、CPU11は、磁気センサ121のオフセットとゲインの補正データを求める(ステップS77)。具体的には、CPU11は、ステップS76の処理に応じて、ユーザが様々な方向にスティック部10を向けたときの地磁気の値を磁気センサ121により計測し、計測した地磁気の値を用いて補正データを求める。オフセットとゲインの値の求め方の例としては、CPU11は、磁気センサ121の各軸の最大値及び最小値からその中央値を算出し、算出した中央値を各軸のオフセット値とする。   Further, the CPU 11 obtains correction data for offset and gain of the magnetic sensor 121 (step S77). Specifically, the CPU 11 measures the geomagnetism value when the user points the stick unit 10 in various directions by the magnetic sensor 121 according to the process of step S76, and corrects it using the measured geomagnetism value. Ask for data. As an example of how to obtain the offset and gain values, the CPU 11 calculates the median value from the maximum value and the minimum value of each axis of the magnetic sensor 121, and sets the calculated median value as the offset value of each axis.

また、CPU11は、各軸の中央から最大値までの値が同じになるようにゲイン補正値を算出し、算出したオフセット値とゲイン補正値をRAM15に記憶する。以降のステップにおいて、CPU11は、磁気センサ121の値を読み出したとき、読み出した値からオフセット値を引いて、さらに補正ゲインを掛けることで、地磁気の値を補正して検出値とする。   Further, the CPU 11 calculates the gain correction value so that the values from the center of each axis to the maximum value are the same, and stores the calculated offset value and gain correction value in the RAM 15. In the subsequent steps, when the CPU 11 reads the value of the magnetic sensor 121, it subtracts the offset value from the read value and further multiplies the correction gain to correct the geomagnetism value to be a detection value.

続いて、CPU11は、検出された地磁気の値が一般の地上で検出される値であるか否かを判定する(ステップS78)。検出された地磁気の値が一般の地上で検出される値ではない場合には、CPU11は、処理をステップS76に戻し、再度、磁気センサ121のオフセット値とゲインの補正データを求める。検出された地磁気の値が一般の地上で検出される値である場合には、CPU11は、処理をステップS79に移行させ、ヨー補正モードを地磁気モードにセットする。   Subsequently, the CPU 11 determines whether or not the detected geomagnetism value is a value detected on a general ground (step S78). When the detected value of the geomagnetism is not a value detected on the general ground, the CPU 11 returns the process to step S76 and obtains the offset value and gain correction data of the magnetic sensor 121 again. When the detected geomagnetism value is a value detected on the general ground, the CPU 11 shifts the processing to step S79 and sets the yaw correction mode to the geomagnetic mode.

また、CPU11は、ステップS78の処理を所定回数(例えば、5回など)実行しても検出された地磁気の値が一般の地上で検出される値ではない場合には、処理をステップS80に移行させ、ヨー補正モードをショットモードにセットする。ステップS79又はステップS80の処理が終了すると、CPU11は、ステップS81に処理を移行させ、ヨー補正モードが地磁気モードであるかショットモードであるかを表示する。例えば、CPU11は、ショットモードの場合にはLED18を赤色で点灯させ、地磁気モードである場合にはLED18を緑色で点灯させる。なお、角速度センサ123及び磁気センサ121のセンサ値の補正処理の順番は、入れ替わってもよい。   Further, if the detected geomagnetism value is not a value detected on the general ground even if the process of step S78 is executed a predetermined number of times (for example, five times), the CPU 11 shifts the process to step S80. And set the yaw correction mode to the shot mode. When the process of step S79 or step S80 ends, the CPU 11 shifts the process to step S81 and displays whether the yaw correction mode is the geomagnetic mode or the shot mode. For example, the CPU 11 lights the LED 18 in red in the shot mode, and lights the LED 18 in green in the geomagnetic mode. Note that the order of the sensor value correction processing of the angular velocity sensor 123 and the magnetic sensor 121 may be switched.

[姿勢推定]
図8を参照して、図6のステップS17の姿勢推定処理の詳細説明を行う。
[Attitude estimation]
With reference to FIG. 8, the posture estimation process in step S17 of FIG. 6 will be described in detail.

図8は、姿勢推定処理の流れを示すフローチャートである。
ワールド座標系から見たローカル座標系のx軸、y軸、z軸の基底ベクトルをe,e,eとして、各基底ベクトルを列に並べた行列TL→W=(e)を定義すると、ローカル座標系の点p=(xyz)と、この点pに対応するワールド座標系の点P=(XYZ)との間には、次の関係式(1)、(2)が成り立つ(演算記号Tは転置行列を意味する)。
P=TL→Wp (1) p=TL→W P (2)
FIG. 8 is a flowchart showing the flow of posture estimation processing.
X-axis of the local coordinate system as viewed from the world coordinate system, y-axis, a basis vector e x and z-axis, e y, as e z, the matrix of each basis vectors arranged in columns T L → W = (e x e y ez ) is defined, the following relational expression (1) exists between the point p = (xyz) T in the local coordinate system and the point P = (XYZ) T in the world coordinate system corresponding to the point p. ), (2) holds (the operation symbol T means a transposed matrix).
P = T L → W p ( 1) p = T L → W T P (2)

このように、TL→Wは2つの座標系の関係を示すものであるので、このように、2つの座標系同士の関係などを用いて現在のスティック姿勢状態を表すことができる。なお、姿勢の表現方法としては、ピッチ、ヨー、ロールなどの角度を用いてもよい。 Thus, TL → W indicates the relationship between the two coordinate systems, and thus the current stick posture state can be expressed using the relationship between the two coordinate systems. In addition, as a method of expressing the posture, an angle such as pitch, yaw, or roll may be used.

ところで、今回時刻tで読み取った角速度センサ123の値からローカル座標系の各軸成分を持つ3次の角速度ベクトルを取得できる。この3次の角速度ベクトルの各軸成分の値に角速度センサ123のサンプリング時間であるδTを掛け算することで、回転角ベクトルθt=(θxtθytθztを求められる。 By the way, a tertiary angular velocity vector having each axis component of the local coordinate system can be acquired from the value of the angular velocity sensor 123 read at the current time t. The rotation angle vector θt = (θ xt θ yt θ zt ) T can be obtained by multiplying the value of each axial component of this cubic angular velocity vector by δT, which is the sampling time of the angular velocity sensor 123.

この回転角ベクトルによってスティックの姿勢を求めることができる。具体的には、時刻tにおける姿勢TL→Wtは、x軸を中心としたθxtの回転、y軸を中心としたθytの回転、及びz軸を中心としたθztの回転の合成行列Rall(θ)と、前回の姿勢TL→Wt−1とを用いて、TL→Wt=Rall(θ)・TL→Wt−1と推定できる。このように、CPU11は、今回の角速度センサ123の値に基づいて、前回の姿勢を更新させて、今回の姿勢を推定する(ステップS101)。 The posture of the stick can be obtained from this rotation angle vector. Specifically, the posture T L → Wt at time t is a combination of θ xt rotation about the x axis, θ yt rotation about the y axis, and θ zt rotation about the z axis. By using the matrix R allt ) and the previous posture T L → Wt−1, it can be estimated that T L → Wt = R allt ) · T L → Wt−1 . As described above, the CPU 11 updates the previous posture based on the value of the current angular velocity sensor 123, and estimates the current posture (step S101).

ところが、このようにして求めた姿勢は誤差が累積していく。また、姿勢が一度間違ってしまうと、その後の姿勢推定の精度が著しく悪化する。例えば、スティック部10を前方水平からまっすぐに右水平に向かって回転したことを考える。最初に水平でなく垂直方向の回転に誤差が入るとスティックの先端の軌跡は斜めに上がりながら回転することになる、その後、この姿勢に関してまた、新しい回転が加わっていくので加速的に本来の姿勢からずれる。したがって、重力推定をおこなうことで、姿勢推定の補正を行い、姿勢の精度を高める。   However, errors are accumulated in the posture obtained in this way. In addition, once the posture is wrong, the accuracy of the posture estimation thereafter is significantly deteriorated. For example, consider that the stick unit 10 is rotated straight from the front horizontal toward the right horizontal. If there is an error in the rotation in the vertical direction instead of in the horizontal direction, the trajectory of the tip of the stick will rotate while moving up diagonally. After that, a new rotation will be added to this posture, so the original posture will be accelerated. Deviate. Therefore, by performing gravity estimation, posture estimation is corrected and posture accuracy is improved.

加速度センサ122で検出される加速度ベクトルはローカル座標系での各軸の成分から構成される。この加速度ベクトルをステップS101で求めた姿勢情報を用いて、ワールド座標系ベクトルで表す。   The acceleration vector detected by the acceleration sensor 122 is composed of components of each axis in the local coordinate system. This acceleration vector is represented by a world coordinate system vector using the posture information obtained in step S101.

外力が加わらなければ、加速度センサ122は重力のみを検出することになるので、加速度センサ122が検出したローカル座標系での加速度ベクトルをワールド座標系に変換すると、常に同じ方向を示すことになる。しかし、スティック部10の動作中は遠心力などの外力が加わるので常に同じ方向を向くとは限らない。ところが、ユーザは止まった状態でスティック部10をスイングしているので、スティック部10の位置は動かない。また、スティック部10を振り上げたときや、振り下げたときなど、いたるときに速度は0になる。すなわち、加速度ベクトルから重力成分を除いた外力の積分はいたるときに0になる。よってワールド座標系の加速度ベクトルを積分したベクトルは概ね重力方向を示すことになる。この性質を用いてワールド座標系の重力方向を推定する。   If no external force is applied, the acceleration sensor 122 detects only gravity. Therefore, when the acceleration vector in the local coordinate system detected by the acceleration sensor 122 is converted into the world coordinate system, the acceleration sensor 122 always indicates the same direction. However, since an external force such as a centrifugal force is applied during the operation of the stick unit 10, it does not always face the same direction. However, since the user swings the stick unit 10 in a stopped state, the position of the stick unit 10 does not move. In addition, the speed becomes 0 when the stick unit 10 is swung up or down. That is, the integration of the external force obtained by removing the gravity component from the acceleration vector becomes zero every time. Therefore, the vector obtained by integrating the acceleration vector of the world coordinate system generally indicates the direction of gravity. This property is used to estimate the direction of gravity in the world coordinate system.

具体的には、CPU11は、今回時刻tで読み取った加速度センサ122が取得した各軸成分の加速度値を=(Axtytztとし、これはローカル座標系であるので、式(3)に基づいて、ワールド座標系に変換算出する(ステップS102)。
=TL→Wt (3)
Specifically, the CPU 11 sets the acceleration value of each axis component acquired by the acceleration sensor 122 read at the current time t as L A T = (A xt A yt A zt ) T , which is a local coordinate system. Based on the equation (3), conversion to the world coordinate system is calculated (step S102).
W A T = T L → Wt · L A T (3)

次に、CPU11は、ワールド座標系に変換された加速度ベクトルの値について各成分について、現時刻から所定時間前までの平均値を算出して、平均加速度ベクトルを求める。所定時間はスイング状態などで実験的に決定される。CPU11は、この平均加速度ベクトルを重力方向ベクトルgtと推定する(ステップS103)。
具体的には、下記の式(式(4))を定義し、再帰加算によって累算を行う。Kはダンピング係数で、スイング状態などで実験的に決定される。
Gw=k・Gwt−1 (4)
このGwからワールド座標系の重力方向ベクトルgtgt=Gw/|Gw|と推定する。
Next, the CPU 11 calculates an average value from the current time to a predetermined time before each component for the value of the acceleration vector converted into the world coordinate system to obtain an average acceleration vector. The predetermined time is experimentally determined in a swing state or the like. The CPU 11 estimates this average acceleration vector as the gravity direction vector W e gt (step S103).
Specifically, the following formula (formula (4)) is defined, and accumulation is performed by recursive addition. K g is a damping coefficient, and is experimentally determined in a swing state or the like.
Gw t = k g · Gw t−1 + W A t (4)
From this Gw t, the gravity direction vector W e gt of the world coordinate system is estimated as W e gt = Gw t / | Gw t |.

次に、CPU11は、この重力方向ベクトルgtがZ軸の負の方向ベクトル(0 0 −1)になるように、姿勢パラメータTL→Wtを修正する(ステップS104)。具体的には、CPU11は、重力方向ベクトルgtと負の方向ベクトル(0 0 −1)との2つのベクトルに直行する軸を中心に、これら2つのベクトルのなす角度分を回転する操作を行うことで、姿勢パラメータTL→Wtを修正する。これにより、重力方向の補正がおこなわれるので、姿勢推定の精度が向上する。 Next, the CPU 11 corrects the posture parameter T L → Wt so that the gravity direction vector W e gt becomes the negative Z-axis direction vector (0 0 −1) T (step S104). Specifically, the CPU 11 rotates the angle formed by these two vectors around an axis orthogonal to the two vectors of the gravity direction vector W e gt and the negative direction vector (0 0 −1) T. By performing the operation, the posture parameter T L → Wt is corrected. Thereby, since the gravity direction is corrected, the accuracy of posture estimation is improved.

前述した姿勢補正は重力方向のみであるので、Z軸を中心としたヨー角の誤差累積が残る。本実施形態では、ヨー角の補正は、ユーザによるスイッチ操作と、地磁気を用いた補正との2つの方法を提案する。   Since the posture correction described above is only in the direction of gravity, the error accumulation of the yaw angle around the Z axis remains. In the present embodiment, two methods for correcting the yaw angle are proposed: a switch operation by the user and a correction using geomagnetism.

まず、ユーザによるスイッチ操作による補正について説明する。この補正は、ユーザが、スティック部10が前方を向いているタイミングで、スティック部10が備える入力部16(例えば、スイッチ)を、定期的に押すことにより、CPU11が、ヨー角の補正を行うというものである。CPU11は、ヨー方向強制スイッチがONされたか否かを判断する(ステップS109)。この処理では、CPU11は、入力部16から、ヨー方向強制スイッチがONされたことを示す信号を受信したか否かを判断する。   First, correction by a switch operation by a user will be described. In this correction, the CPU 11 corrects the yaw angle when the user periodically presses the input unit 16 (for example, a switch) included in the stick unit 10 at a timing when the stick unit 10 faces forward. That's it. The CPU 11 determines whether or not the yaw direction forced switch is turned on (step S109). In this process, the CPU 11 determines whether or not a signal indicating that the yaw direction forced switch has been turned on has been received from the input unit 16.

ステップS109での判断がYESの場合、CPU11は、スティック部10の先端のワールド座標系の方向ベクトルをワールド座標系のY軸の方向ベクトルと一致させるような回転行列を求め、この回転行列を用いて姿勢パラメータの補正を行う(ステップS110)。これにより、スティック部10の先端のヨー角が0度にセットされる。
この回転行列は、例えば、2つのベクトルをなす角度の長さであって、2つのベクトルに直交するベクトル方向を向いた回転角ベクトルを考える。この回転角ベクトルを角速度センサ123の姿勢補正の合成回転行列を求めた方法と同じ方法で合成行列変換を求めることができる。
If the determination in step S109 is YES, the CPU 11 obtains a rotation matrix that matches the direction vector of the world coordinate system at the tip of the stick unit 10 with the direction vector of the Y axis of the world coordinate system, and uses this rotation matrix. Then, the posture parameter is corrected (step S110). Thereby, the yaw angle at the tip of the stick unit 10 is set to 0 degree.
This rotation matrix is, for example, a length of an angle that forms two vectors, and considers a rotation angle vector that faces a vector direction orthogonal to the two vectors. The composite matrix transformation can be obtained by the same method as the method of obtaining the rotational angle vector and the composite rotational matrix for the posture correction of the angular velocity sensor 123.

次に、地磁気を用いた補正について説明する。   Next, correction using geomagnetism will be described.

ステップS109での判断がNOの場合、CPU11は、ヨー方向補正モードが地磁気モードによる補正モードであるか否かを判定する(ステップS105)。地磁気モードによる補正モードでない場合は、CPU11は、姿勢推定処理を終了する。
地磁気モードによる補正モードである場合には、CPU11は、今回時刻tで読み取った磁気センサ121から求めた地磁気ベクトルの値を=(Mxtytztとし、これはローカル座標系であるので、式(5)に基づいて、ワールド座標系に変換する(ステップS106)。
=TL→Wt (5)
When the determination in step S109 is NO, the CPU 11 determines whether or not the yaw direction correction mode is a correction mode based on the geomagnetic mode (step S105). If the correction mode is not the geomagnetic mode, the CPU 11 ends the posture estimation process.
When the correction mode is the geomagnetic mode, the CPU 11 sets the value of the geomagnetic vector obtained from the magnetic sensor 121 read at the current time t as L M T = (M xt M yt M zt ) T , which is a local coordinate. Since it is a system, it is converted to the world coordinate system based on the equation (5) (step S106).
W M T = T L → Wt · L M T (5)

次に、CPU11は、例えばIIR(Infinite Impulse Response)フィルタを実行し平滑化をおこなう。この平滑して得られた方向を現在の地磁気方向mtと推定する(ステップS107)。
具体的には、下記のIIRフィルタ演算(式(6))を実行し平滑化を行う。kはフィルタ係数でスイング状態などで実験的に決定される。
Mw=(1−k)・Mwt−1+k (6)
このMwからワールド座標系の現在の地磁気方向ベクトルmt
mt=Mw/|Mw|と推定する。
Next, the CPU 11 executes, for example, an IIR (Infinite Impulse Response) filter to perform smoothing. The direction obtained by smoothing is estimated as the current geomagnetic direction W e mt (step S107).
Specifically, smoothing is performed by executing the following IIR filter operation (formula (6)). k m is determined experimentally in such a swing state in filter coefficients.
Mw t = (1-k m ) · Mw t-1 + k m · W A t (6)
From this Mw t, the current geomagnetic direction vector W e mt of the world coordinate system is obtained.
W e mt = Mw t / | Mw t | and to estimate.

続いて、CPU11は、初期状態でのワールド座標系における地磁気の方向m0
をRAM15に記録し、現在の地磁気方向mtと、初期状態でのワールド座標系における地磁気の方向m0
の方向とが、ワールド座標系のXY平面で同じ方向を向くような回転行列を求め、この回転行列を用いて姿勢パラメータTL→Wtの補正を行う(ステップS108)。これにより、地磁気方向の補正が行われるので、姿勢推定の精度が向上する。
この回転行列は、具体的には、各ベクトルのZ成分を0にしたベクトルを考え、その2つのベクトル方向から、重力補正と同様、中心に2つのベクトルをなす角度の長さの2つのベクトルに直交するベクトル方向を向いたベクトルを考え、この各成分の値の回転の合成行列変換で表現できる。
Subsequently, the CPU 11 determines the geomagnetic direction W e m0 in the world coordinate system in the initial state.
Are stored in the RAM 15, and the current geomagnetic direction W e mt and the initial geomagnetic direction W e m0 in the world coordinate system are recorded.
A rotation matrix is obtained so that the direction of is oriented in the same direction on the XY plane of the world coordinate system, and the posture parameter T L → Wt is corrected using this rotation matrix (step S108). Thereby, since the correction of the geomagnetic direction is performed, the accuracy of posture estimation is improved.
Specifically, the rotation matrix is a vector in which the Z component of each vector is set to 0. From the two vector directions, two vectors having the length of an angle that forms two vectors at the center, as in gravity correction, are used. Considering a vector oriented in the vector direction orthogonal to, it can be expressed by a composite matrix transformation of the rotation of each component value.

[位置推定]
図9を参照して、図6のステップS18の位置推定処理の詳細説明を行う。
[Position estimation]
With reference to FIG. 9, the position estimation process in step S18 of FIG. 6 will be described in detail.

図9は、位置推定処理の流れを示すフローチャートである。
姿勢推定する際に、図8のステップS103において、ワールド座標の重力方向gtを推定した。CPU11は、ワールド座標系の加速度ベクトルからその重力方向gtの成分を除いたベクトルを求め、このベクトルを外力による加速度と定義する(ステップS201)。さらに、CPU11は、外力による加速度を積分して移動速度を求め、さらにこの移動速度を積分して水平面の移動量を求める(ステップS202)。
FIG. 9 is a flowchart showing the flow of the position estimation process.
When estimating the posture, the gravity direction W e gt of the world coordinates was estimated in step S103 of FIG. CPU11 obtains a vector excluding the component of the gravity direction W e gt from the acceleration vector in the world coordinate system to define this vector and acceleration W F T due to an external force (step S201). Furthermore, CPU 11 obtains the moving velocity W v t by integrating the acceleration W F T due to an external force, calculating the moving amount W D t of the horizontal plane and further integrates the moving velocity W v t (step S202).

なお、積分は完全積分では誤差累積の影響が出るので不完全積分を用いるのが望ましい。ダンピング係数(時定数)は実験にて調整をおこなう。このようにして求めた値は後のノートイベント生成処理(図16参照)で利用される、   In addition, it is desirable to use incomplete integration because integration is affected by error accumulation in complete integration. The damping coefficient (time constant) is adjusted by experiment. The value obtained in this way is used in a later note event generation process (see FIG. 16).

[先端動き予測]
図10及び図11を参照して、図6のステップS19の先端動き予測処理の詳細説明を行う。
[Tip motion prediction]
With reference to FIG.10 and FIG.11, the tip movement prediction process of step S19 of FIG. 6 is demonstrated in detail.

発音の強弱はスティック先端の速度で制御をおこなうことが望ましい。速度を予測するのに加速度センサから求める方法があるが精度上問題がある。また、角速度だけではスティックのスイングはひじや肩を中心とした回転運動またはひじなどを伸ばしながらスイングするので、角速度と速度が比例関係になるともいえない。そのため、本実施形態では、先端の角速度と角加速度で速度予測する。   It is desirable to control the sound intensity at the speed of the stick tip. There is a method for obtaining the speed from an acceleration sensor, but there is a problem in accuracy. In addition, since the swing of the stick swings while rotating the elbow or the like around the elbow or the shoulder only by the angular velocity, the angular velocity and the velocity cannot be said to be in a proportional relationship. Therefore, in this embodiment, the speed is predicted by the angular velocity and angular acceleration of the tip.

図10は、先端動き予測処理の流れを示すフローチャートである。
求め方の一例として、まず、CPU11は、角速度ベクトルからy軸周りの成分を除いた角速度をスティック先端の角速度の観測値ωV=(ωxt0 ωztとし、その値をカルマンフィルタなどを用いて角速度ωs及び角加速度δωsと推定する(ステップS210)。
FIG. 10 is a flowchart showing the flow of the tip motion prediction process.
As an example of how to obtain it, first, the CPU 11 uses the angular velocity obtained by removing the component around the y-axis from the angular velocity vector as the observed value ωV t = (ω xt 0 ω zt ) T of the stick tip angular velocity, and uses that value as the Kalman filter or the like. The angular velocity ωs and the angular acceleration δωs are used for estimation (step S210).

例えば、それぞれの角速度成分は、前回の角速度成分に角加速度成分を加えたもの、角加速度成分は、前回と同じ角加速度成分に駆動ノイズが加わるような状態モデルを利用して求めることができる。CPU11は、このようにして得られたスティック先端の角速度を用いて、その角速度の直近の平均したベクトル方向をスティック先端速度回転軸eとして推定する(ステップS211)。 For example, each angular velocity component is obtained by adding an angular acceleration component to the previous angular velocity component, and the angular acceleration component can be obtained using a state model in which drive noise is added to the same angular acceleration component as the previous time. CPU11 using the angular velocity of the stick tip thus obtained to estimate the most recent average vector direction of the angular velocity as a stick tip speed rotary shaft e r (step S211).

本実施例ではカルマンフィルタで実現したが、IIRフィルタを用いてセンサの値及びその差分をスムージングしてそれぞれ角速度、角加速度を求めても良い。   In this embodiment, the Kalman filter is used. However, the angular velocity and the angular acceleration may be obtained by smoothing the sensor value and its difference using an IIR filter.

スティック先端回転軸とスティックの方向y軸と直行する方向(外積方向、図11参照)をスイング方向eと定義する。先端の回転運動の接線方向はこの方向を向く。CPU11は、加速度ベクトルのスイング方向の成分Asを、とeとの内積を計算することで求める(ステップS212)。 Stick tip rotation axis direction perpendicular to the direction y-axis of the stick (cross product direction, see FIG. 11) is defined as the swing direction e s. The tangential direction of the rotational movement of the tip is in this direction. CPU11 is the component L As t swing direction of the acceleration vector L A t, and calculating the inner product of L A t and e s (step S212).

[発音タイミング検出処理]
図12又は図13を参照して、図6のステップS20の発音タイミング検出処理の詳細説明を行う。
[Sounding timing detection processing]
With reference to FIG. 12 or FIG. 13, the detailed description of the sound generation timing detection process of step S20 of FIG. 6 is given.

[発音タイミング検出処理(第1の実施例)]
図12は、第1の実施例における発音タイミング検出処理の流れを示すフローチャートである。
まず、CPU11は、動作状態に応じて分岐を行う(ステップS302)。動作状態にはIDLE、ACTION、SHOT及びDONEの4状態がある。CPU11は、IDLEの場合には、処理をステップS303に移行させ、ACTIONの場合には、処理をステップS320に移行させ、SHOTの場合には、処理をステップS330に移行させ、DONEの場合には、処理をステップS340に移行させる。
[Sound generation timing detection processing (first embodiment)]
FIG. 12 is a flowchart showing the flow of sound generation timing detection processing in the first embodiment.
First, the CPU 11 branches according to the operation state (step S302). There are four operating states: IDLE, ACTION, SHOT, and DONE. The CPU 11 shifts the process to step S303 in the case of IDLE, shifts the process to step S320 in the case of ACTION, shifts the process to step S330 in the case of SHOT, and shifts the process to step S330 in the case of DONE. Then, the process proceeds to step S340.

ここで、標準的な動作状態の遷移を図14に示す。図14は、横軸は、時間軸を示しており、縦軸は、図Aでは角速度の大きさ(ベクトルの長さ)を示している。符号はあまり意味がないが、便宜上、スティック部10を振り始めた方向を正とする。また、縦軸は、図Bでは角加速度の大きさ(ベクトルの長さ)を示している。符号は角速度の正方向と同じ向きを正とする。図Cは動作状態の遷移を示している。   Here, the transition of the standard operation state is shown in FIG. In FIG. 14, the horizontal axis represents the time axis, and the vertical axis represents the magnitude of the angular velocity (the length of the vector) in FIG. The sign has little meaning, but for the sake of convenience, the direction in which the stick unit 10 is started to swing is positive. The vertical axis indicates the magnitude of the angular acceleration (the length of the vector) in FIG. The sign is positive in the same direction as the positive direction of angular velocity. FIG. C shows the transition of the operating state.

スティックが停止している状態はIDLEであり、初期状態で動作状態はIDLEに初期化されている。初期状態の時刻t0では動作状態はIDLEである。このときCPU11は、スティック部10の角加速度が正でない場合には、発音タイミング検出処理を終了する(ステップS303)。スティック部10の角加速度が正の場合であってもスティック部10の角速度が「閾値1」以下の場合には、CPU11は、発音タイミング検出処理を終了する(ステップS304)。スティック部10の角速度が「閾値1」の値を超えた場合、CPU11は、ステップS305に処理を移行させる(ステップS304)。図14では、t2の時刻で、「閾値1」を超えたことが示されている。ステップS305では、CPU11は、動作状態をACTIONに変更させ(ステップS305)、最大角速度を0に初期化して(ステップS306)、発音タイミング検出処理を終了する。
動作状態がACTIONになると、しばらくスティックは加速し続け、この間は、角加速度が正であるので、CPU11は、ステップS320でYESと判断し、現在の角速度が保持されている最大角速度と比較し(ステップS321)、角速度が最大角速度より大きい場合には、最大角速度を更新して(ステップS322)、「閾値2」を更新する(ステップS323)。角速度が最大角速度より小さい場合には、CPU11は、発音タイミング検出処理を終了する。
The state where the stick is stopped is IDLE, and the operation state is initialized to IDLE in the initial state. The operation state is IDLE at time t0 in the initial state. At this time, if the angular acceleration of the stick unit 10 is not positive, the CPU 11 ends the sound generation timing detection process (step S303). Even if the angular acceleration of the stick unit 10 is positive, if the angular velocity of the stick unit 10 is “threshold 1” or less, the CPU 11 ends the sound generation timing detection process (step S304). When the angular velocity of the stick unit 10 exceeds the value of “threshold 1”, the CPU 11 shifts the processing to step S305 (step S304). FIG. 14 shows that “threshold value 1” was exceeded at time t2. In step S305, the CPU 11 changes the operation state to ACTION (step S305), initializes the maximum angular velocity to 0 (step S306), and ends the sound generation timing detection process.
When the operation state becomes ACTION, the stick keeps accelerating for a while. Since the angular acceleration is positive during this period, the CPU 11 determines YES in step S320 and compares the current angular velocity with the maximum angular velocity held ( In step S321), when the angular velocity is larger than the maximum angular velocity, the maximum angular velocity is updated (step S322), and "threshold value 2" is updated (step S323). When the angular velocity is smaller than the maximum angular velocity, the CPU 11 ends the sound generation timing detection process.

「閾値2」は最大角速度の値によって決定されるようになっている。例えば、「閾値2」=(最大角速度)×Cで求める、ここで、Cは、0〜1の値で実験的に決定される。通常は0.1程度が望ましい。この「閾値2」はショットを検出してから音が発音するまでの遅延時間に相当する事前の角速度を想定している。無線の伝達遅延や、後に述べる発音処理に遅延が生じるので、その遅延分を保証するために本来の音の鳴らすタイミングより、事前に音を鳴らすためである。一般にショットの角速度のカーブは音の強弱に比例した形であることを想定し、角速度の最大値から、閾値を決定している。   “Threshold 2” is determined by the value of the maximum angular velocity. For example, “threshold 2” = (maximum angular velocity) × C, where C is experimentally determined by a value of 0 to 1. Usually about 0.1 is desirable. This “threshold 2” assumes a prior angular velocity corresponding to a delay time from when a shot is detected until sound is generated. This is because a radio transmission delay and a later-described sound generation process are delayed, so that the sound is sounded in advance from the original sounding timing in order to guarantee the delay. In general, it is assumed that the shot angular velocity curve is proportional to the intensity of the sound, and the threshold is determined from the maximum value of the angular velocity.

スティック部10が減速状態に変わると(t3)、スティック部10の角加速度は0以下となるので、CPU11は、ステップS320でNOと判断する。ステップS324では、CPU11は、現在の角速度の絶対値が「閾値2」より小さいか否か比較する。スティックがまだ十分に減速されていない間は、CPU11は、ステップS324でNOと判断し、発音タイミング検出処理を終了して、ショットタイミングを待つことになる。   When the stick unit 10 changes to the deceleration state (t3), the angular acceleration of the stick unit 10 becomes 0 or less, so the CPU 11 determines NO in step S320. In step S324, the CPU 11 compares whether or not the absolute value of the current angular velocity is smaller than “threshold value 2”. While the stick has not been sufficiently decelerated, the CPU 11 determines NO in step S324, ends the sound generation timing detection process, and waits for the shot timing.

スティックが十分に減速し、「閾値2」より小さくなると、CPU11は、ショットタイミングに近づいたと判定し、ステップS324でYESと判断し(t4のタイミング)、動作状態をSHOTに設定し(ステップS325)、ショット通過時間を0に初期化する(ステップS326)。その後、CPU11は、発音タイミング検出処理を終了する。このSHOT状態は発音タイミングを知らせるものであり、図6のステップS22の発音タイミングの判断に用いられる。   When the stick is sufficiently decelerated and becomes smaller than “threshold 2”, the CPU 11 determines that it is close to the shot timing, determines YES in step S324 (timing of t4), and sets the operation state to SHOT (step S325). The shot passage time is initialized to 0 (step S326). Thereafter, the CPU 11 ends the sound generation timing detection process. This SHOT state informs the sound generation timing, and is used to determine the sound generation timing in step S22 of FIG.

動作状態がSHOTの場合には、CPU11は、動作状態をステップS330においてDONEに更新して、発音タイミング検出処理を終了する。   If the operation state is SHOT, the CPU 11 updates the operation state to DONE in step S330, and ends the sound generation timing detection process.

動作状態がDONEの場合には、CPU11は、角速度が「閾値3」以下であるか否かを判断し(ステップS340)、角速度が「閾値3」以下であると判断した場合には、動作状態をIDLEに変更し(ステップS341)、発音タイミング検出処理を終了する。ステップS340において、CPU11は、角速度が「閾値3」より大きいと判断した場合には、ショット通過時間が「閾値4」以下であるか否かを判断し(ステップS342)、ショット通過時間が「閾値4」以下であると判断した場合には、発音タイミング検出処理を終了する。一方、CPU11は、ショット通過時間が「閾値4」を超えたと判断した場合には、動作状態をIDLEに変更し(ステップS341)、発音タイミング検出処理を終了する。   When the operation state is DONE, the CPU 11 determines whether or not the angular velocity is “threshold 3” or less (step S340), and when it is determined that the angular velocity is “threshold 3” or less, the operation state Is changed to IDLE (step S341), and the sound generation timing detection process is terminated. In step S340, when the CPU 11 determines that the angular velocity is greater than “threshold 3”, the CPU 11 determines whether or not the shot passage time is equal to or less than “threshold 4” (step S342). If it is determined that it is 4 ”or less, the sound generation timing detection process is terminated. On the other hand, if the CPU 11 determines that the shot passage time has exceeded “threshold 4”, the CPU 11 changes the operation state to IDLE (step S341), and ends the sound generation timing detection process.

すなわち、DONE状態は角速度が「閾値3」以下になるまで保持される。これは停止時に複数音が鳴ったりする誤動作を防止するためである。しかし、角速度がゆっくりと減速されて、角速度が「閾値3」以下になるまでのショット通過時間が「閾値4」を超えた場合には、動作状態はDONEからIDLEに変更される。   That is, the DONE state is held until the angular velocity becomes “threshold 3” or less. This is to prevent malfunctions such as multiple sounds when stopping. However, when the angular velocity is slowly decelerated and the shot passing time until the angular velocity becomes “threshold 3” or less exceeds “threshold 4”, the operation state is changed from DONE to IDLE.

[発音タイミング検出処理(第2の実施例)] [Sound generation timing detection processing (second embodiment)]

図13は、第2の実施例における発音タイミング検出処理の流れを示すフローチャートである。
まず、CPU11は、動作状態に応じて分岐を行う(ステップS352)。動作状態にはIDLE、ACTION、SHOT及びDONEの4状態がある。CPU11は、IDLEの場合には、処理をステップS353に移行させ、ACTIONの場合には、処理をステップS370に移行させ、SHOTの場合には、処理をステップS380に移行させ、DONEの場合には、処理をステップS390に移行させる。ここで、標準的な動作状態の遷移は図14に示したとおり第1の実施例と同様である。
FIG. 13 is a flowchart showing the flow of sound generation timing detection processing in the second embodiment.
First, the CPU 11 branches according to the operation state (step S352). There are four operating states: IDLE, ACTION, SHOT, and DONE. The CPU 11 shifts the process to step S353 in the case of IDLE, shifts the process to step S370 in the case of ACTION, shifts the process to step S380 in the case of SHOT, and shifts the process to step S380 in the case of DONE. Then, the process proceeds to step S390. Here, the transition of the standard operation state is the same as that of the first embodiment as shown in FIG.

CPU11は、スティック部10の角加速度が正でない場合には、発音タイミング検出処理を終了する(ステップS353)。スティック部10の角加速度が正の場合であってもスティック部10の角速度が「閾値1」以下の場合には、CPU11は、発音タイミング検出処理を終了する(ステップS354)。スティック部10の角速度が「閾値1」の値を超えた場合、CPU11は、ステップS355に処理を移行させる(ステップS354)。図14では、t2の時刻で、「閾値1」を超えたことが示されている。ステップS355では、CPU11は、動作状態をACTIONに変更させ(ステップS355)、発音タイミング検出処理を終了する。   If the angular acceleration of the stick unit 10 is not positive, the CPU 11 ends the sound generation timing detection process (step S353). Even if the angular acceleration of the stick unit 10 is positive, if the angular velocity of the stick unit 10 is not more than “threshold 1”, the CPU 11 ends the sound generation timing detection process (step S354). When the angular velocity of the stick unit 10 exceeds the value of “threshold 1”, the CPU 11 shifts the processing to step S355 (step S354). FIG. 14 shows that “threshold value 1” was exceeded at time t2. In step S355, the CPU 11 changes the operation state to ACTION (step S355), and ends the sound generation timing detection process.

動作状態がACTIONになると、しばらくスティックは加速し続け、この間は、角加速度が正であるので、CPU11は、ステップS370でYESと判断し、発音タイミング検出処理を終了する。   When the operation state becomes ACTION, the stick continues to accelerate for a while. Since the angular acceleration is positive during this period, the CPU 11 determines YES in step S370 and ends the sound generation timing detection process.

スティック部10が減速状態に変わると(t3)、スティック部10の角加速度は0以下となるので、CPU11は、ステップS370でNOと判断する。CPU11は、ステップS371で、現在のスティック先端角速度ωs、角加速度δωsから角速度が0になるまでの時間を推測する。その推測された時間をTremとすると、
Trem=|ωs|/|δωs|でおよその時間を推定できる。
When the stick unit 10 changes to the deceleration state (t3), the angular acceleration of the stick unit 10 becomes 0 or less, so the CPU 11 determines NO in step S370. In step S371, the CPU 11 estimates the time from the current stick tip angular velocity ωs t and angular acceleration δωs t until the angular velocity becomes zero. If the estimated time is Trem,
The approximate time can be estimated with Trem = | ωs t | / | δωs t |.

続いて、CPU11は、推定した時間が「閾値5」以下であるかを判定する(ステップS372)。例えばこの「閾値5」は10m秒程度とする。   Subsequently, the CPU 11 determines whether or not the estimated time is “threshold 5” or less (step S372). For example, the “threshold value 5” is about 10 milliseconds.

この「閾値5」はショットを検出してから音が発音するまでの遅延時間として設定されている。無線の伝達遅延や、後に述べる発音処理に遅延が生じるので、その遅延分を保証するために本来の音の鳴らすタイミングより、事前に音を鳴らすためである。CPU11は、スティック部10が十分に減速するまでは、ステップS372ではNOと判断して発音タイミング検出処理を終了する。やがてスティック部10の角速度が0に近くなると、停止(角速度0)までの推定時間が「閾値5」以下となり、CPU11は、ステップS372ではYESと判断し(t4のタイミング)、動作状態をSHOTに設定し(ステップS373)、SHOT通過時間を0に初期化する(ステップS374)。このSHOT状態は発音タイミングを知らせるものであり、図6のステップS22の発音タイミングの判断に用いられる。   This “threshold value 5” is set as a delay time from when a shot is detected until sound is generated. This is because a radio transmission delay and a later-described sound generation process are delayed, so that the sound is sounded in advance from the original sounding timing in order to guarantee the delay. The CPU 11 determines NO in step S372 and ends the sound generation timing detection process until the stick unit 10 is sufficiently decelerated. Eventually, when the angular velocity of the stick unit 10 becomes close to 0, the estimated time until the stop (angular velocity 0) becomes “threshold 5” or less, and the CPU 11 determines YES in step S372 (timing t4) and sets the operation state to SHOT. It is set (step S373), and the SHOT passage time is initialized to 0 (step S374). This SHOT state informs the sound generation timing, and is used to determine the sound generation timing in step S22 of FIG.

動作状態がSHOTの場合には、CPU11は、動作状態をステップS380においてDONEに更新して、発音タイミング検出処理を終了する。   If the operating state is SHOT, the CPU 11 updates the operating state to DONE in step S380, and ends the sound generation timing detection process.

動作状態がDONEの場合には、CPU11は、角速度が「閾値3」以下であるか否かを判断し(ステップS390)、角速度が「閾値3」以下であると判断した場合には、動作状態をIDLEに変更し(ステップS391)、発音タイミング検出処理を終了する。ステップS390において、CPU11は、角速度が「閾値3」より大きいと判断した場合には、ショット通過時間が「閾値4」以下であるか否かを判断し(ステップS392)、ショット通過時間が「閾値4」以下であると判断した場合には、発音タイミング検出処理を終了する。一方、CPU11は、ショット通過時間が「閾値4」を超えたと判断した場合には、動作状態をIDLEに変更し(ステップS391)、発音タイミング検出処理を終了する。   When the operation state is DONE, the CPU 11 determines whether or not the angular velocity is “threshold 3” or less (step S390), and when it is determined that the angular velocity is “threshold 3” or less, the operation state Is changed to IDLE (step S391), and the sound generation timing detection process is terminated. In step S390, if the CPU 11 determines that the angular velocity is greater than “threshold 3”, the CPU 11 determines whether or not the shot passage time is equal to or less than “threshold 4” (step S392). If it is determined that it is 4 ”or less, the sound generation timing detection process is terminated. On the other hand, if the CPU 11 determines that the shot passage time has exceeded the “threshold value 4”, the CPU 11 changes the operation state to IDLE (step S391) and ends the sound generation timing detection process.

すなわち、DONE状態は角速度が「閾値3」以下になるまで保持される。これは停止時に複数音が鳴ったりする誤動作を防止するためである。しかし、角速度がゆっくりと減速されて、角速度が「閾値3」以下になるまでのショット通過時間が「閾値4」を超えた場合には、動作状態はDONEからIDLEに変更される。   That is, the DONE state is held until the angular velocity becomes “threshold 3” or less. This is to prevent malfunctions such as multiple sounds when stopping. However, when the angular velocity is slowly decelerated and the shot passing time until the angular velocity becomes “threshold 3” or less exceeds “threshold 4”, the operation state is changed from DONE to IDLE.

[発音量検出]
図15を参照して、図6のステップS21の発音量検出処理の詳細説明を行う。
[Sounding volume detection]
With reference to FIG. 15, the sound production amount detection process in step S <b> 21 of FIG. 6 will be described in detail.

図15は、発音量検出処理の流れを示すフローチャートである。
CPU11は、動作状態を判定し、動作状態がDONE又はIDLEである場合には、ステップS402に処理を移行させ、動作状態がACTION又はSHOTである場合には、ステップS406に処理を移行させる。
FIG. 15 is a flowchart showing the flow of the sound generation amount detection process.
The CPU 11 determines the operation state. If the operation state is DONE or IDLE, the CPU 11 shifts the process to step S402. If the operation state is ACTION or SHOT, the CPU 11 shifts the process to step S406.

動作状態がDONE又はIDLEである場合には、CPU11は、ピーク角速度値(スカラー量)ωs peak、シフト速度vs、ピークシフト速度vspeak、及びピークシフト加速度aspeakを0に初期化する(ステップS402〜S405)。 When the operation state is DONE or IDLE, the CPU 11 initializes the peak angular velocity value (scalar amount) ω s peak , the shift velocity vs t , the peak shift velocity vs peak , and the peak shift acceleration as peak to 0 ( Steps S402 to S405).

ピーク角速度値ωs peakは、スティックが発音スイング中に検出した角速度の最大値、シフト速度vsはスティックの先端の平行移動分の速度成分、現在のピークシフト速度vspeakはシフト速度Vsの最大値を保持している値である。発音タイミング検出(図12のステップS305、又は図13のステップS355)においてスティックのスイングが検出され、動作状態がACTION又はSHOTになると、CPU11は、現在のスティック先端角速度ベクトルのスカラー量|ωst|とピーク角速度値ωs peakとを比較し、|ωst|の方が大きい場合、ωs peakを|ωst|の値に更新する(ステップS406)。 The peak angular velocity value ω s peak is the maximum value of the angular velocity detected by the stick during the sounding swing, the shift velocity vs t is the velocity component of the translation of the tip of the stick, and the current peak shift velocity vs peak is the shift velocity L Vs t. Is the value holding the maximum value of. When the swing of the stick is detected in the sound generation timing detection (step S305 in FIG. 12 or step S355 in FIG. 13) and the operation state becomes ACTION or SHOT, the CPU 11 determines the scalar amount of the current stick tip angular velocity vector | ω st | Is compared with the peak angular velocity value ω s peak, and if | ω st | is larger, ω s peak is updated to the value of | ω st | (step S406).

次に、CPU11は、図10のステップS212で求めたスイング方向の加速度成分Asのシフト加速度のピーク値aspeakの保持と更新を行う(ステップS407)。 Then, CPU 11 performs the holding and updating the peak value the as peak shift acceleration of the acceleration component L As t swing direction obtained in the step S212 of FIG. 10 (step S407).

続いて、CPU11は、図10のステップS212で求めたスイング方向の加速度成分Asを不完全積分し、スイング方向の速度Vsを得る(ステップS408)。 Subsequently, CPU 11 is incomplete integrating the acceleration component L As t swing direction obtained in the step S212 of FIG. 10, to obtain a swing direction of the velocity L Vs t (step S408).

CPU11は、前記のスイング方向速度Vsとピーク角速度値vspeakとを比較し、Vsの方が大きい場合、vspeakVsの値に更新する(ステップS409)。 CPU11 compares the said swing direction velocity L Vs t and the peak velocity value vs peak, when towards L Vs t is large, updates vs peak to the value of L Vs t (step S409).

次に、CPU11は、3つのピーク値からスティックの速度(音量)を求める。例えば、次の式(5)ような重み付き加算等で求める。
shot=a・ωs peak+a・vspeak+a・aspeak (5)
ここで、a,a,aはミキシングパラメータであり、実験にて決定される。
このPshotは、ショットの音の大きさとして利用される。
Next, the CPU 11 obtains the speed (volume) of the stick from the three peak values. For example, it is obtained by weighted addition as in the following equation (5).
P shot = a 1 · ω s peak + a 2 · vs peak + a 3 · as peak (5)
Here, a 1 , a 2 , and a 3 are mixing parameters, which are determined by experiments.
This P shot is used as the loudness of the shot.

[ノートイベント生成]
図16を参照して、図6のステップS23のノートイベント生成処理の詳細説明を行う。
[Create note event]
Referring to FIG. 16, the note event generation process in step S23 of FIG. 6 will be described in detail.

図16は、ノートイベント生成処理の流れを示すフローチャートである。
ショット時に、空間上に仮想的に配列された音源のどれを鳴らすかが決定されるが、ショットタイミングはシステムの遅延を考慮して先行して検出されているので、CPU11は、音が鳴るときのスティック部10の位置の推定を行う(ステップS501)。スティック部10の先端の角速度と角加速度がわかっているので、CPU11は、Trem後のスティックの姿勢を求めることにより位置を推定できる。具体的には、CPU11は、Tremをさらに時間を細分化し、その時間間隔をTとし、各時間の角速度ベクトルを前回の角速度ベクトル及び角加速度ベクトルから求める。さらに、CPU11は、この角速度ベクトルで、各時間間隔の回転角ベクトルを求め、この回転角ベクトルを用いて、合成回転行列を求め、次の姿勢を予測する。これをTremまで繰り返すことでTrem秒後の姿勢をTL→Wt+Tremと予測することができる。この姿勢パラメータからスティック部10の先端方向y軸のワールド座標系の位置P=(PyXyYyZを得ることができる。
FIG. 16 is a flowchart showing the flow of note event generation processing.
It is determined which sound source virtually arranged in space at the time of a shot, but since the shot timing is detected in advance in consideration of the delay of the system, the CPU 11 The position of the stick unit 10 is estimated (step S501). Since the angular velocity and angular acceleration at the tip of the stick unit 10 are known, the CPU 11 can estimate the position by obtaining the posture of the stick after Trem. Specifically, the CPU 11 further subdivides the time into Trem, sets the time interval as T, and obtains the angular velocity vector of each time from the previous angular velocity vector and angular acceleration vector. Further, the CPU 11 obtains a rotation angle vector at each time interval from the angular velocity vector, obtains a composite rotation matrix using the rotation angle vector, and predicts the next posture. By repeating this until Trem, the posture after Trem seconds can be predicted as TL → Wt + Trem . From this posture parameter, the position P y = (P yX P yY P yZ ) T in the world coordinate system of the y-axis in the tip direction of the stick unit 10 can be obtained.

音源がワールド座標系に6つマップ(配置)されている場合、それぞれの音源の位置(ワールド座標系)を、例えば、
音源1:(0,1,0)前方
音源2:(sin60,cos60,0)前方右60度方向
音源3:(−sin60,cos60,0)前方左60度方向
音源4:(0,cos45,sin45)前方上部45度方向
音源5:(cos45sin60,cos45cos60,sin45)前方右60度、上部45度方向
音源6:(−cos45sin60,cos45cos60,sin45)前方左60度、上部45度方向
とする。
When six sound sources are mapped (arranged) in the world coordinate system, the position (world coordinate system) of each sound source is, for example,
Sound source 1: (0, 1, 0) forward Sound source 2: (sin 60, cos 60, 0) Forward right 60 degree direction Sound source 3: (-sin 60, cos 60, 0) Forward left 60 degree direction Sound source 4: (0, cos 45, sin 45) Front upper 45 degrees direction Sound source 5: (cos 45 sin 60, cos 45 cos 60, sin 45) Front right 60 degrees, upper 45 degrees direction Sound source 6: (-cos 45 sin 60, cos 45 cos 60, sin 45) Forward left 60 degrees, upper 45 degrees direction.

この各音源の位置情報と各音源番号に対応する音色は、ROM14のメモリ上に予め記憶されている。
CPU11は、ステップS501で推定した発音時のスティック部10の位置Pとそれぞれの音源位置Psi=(PsiXsiYsiZとの距離を求め、一番近いものを今回のショット対象の音源とする(ステップS502)。
The position information of each sound source and the timbre corresponding to each sound source number are stored in advance in the memory of the ROM 14.
The CPU 11 obtains the distance between the position P y of the stick unit 10 at the time of sound generation estimated in step S501 and each sound source position P si = (P siX P siY P siZ ) T, and the closest one is subject to the current shot. (Step S502).

距離測定は、ユークリッド距離を算出する。または、スイング方向軸の距離には鈍感になるような成分毎に重みつきユークリッド距離を用いることも有効である。スイング方向は移動方向なので精度が悪いので、回転軸方向より重みを大きくした距離を用いた方が望ましい。   The distance measurement calculates the Euclidean distance. Alternatively, it is also effective to use a weighted Euclidean distance for each component that is insensitive to the distance in the swing direction axis. Since the swing direction is a moving direction and accuracy is poor, it is desirable to use a distance with a greater weight than the rotation axis direction.

または、方位はピッチ、ヨー、ロール角度表現に変換できる。この角度表記で音源位置、スティックの位置を角度表記に変換し、距離を求めても良い。この際、ピッチ方向とヨー方向で重みを変えた距離を用いても良い。ロール成分の重みは0が望ましい。   Alternatively, the orientation can be converted to a pitch, yaw, roll angle representation. The distance may be obtained by converting the sound source position and the stick position into the angle notation by this angle notation. At this time, a distance in which the weight is changed between the pitch direction and the yaw direction may be used. The roll component weight is preferably zero.

ステップS502でショット対象とした音源番号、又は、図17を参照して後述するサウンド探索処理において決定された音源番号をiとすると、CPU11は、i番目の音源に対応するノートをテーブルから読み出し(ステップS503)、発音するノートを得ることができる。   Assuming that the sound source number shot in step S502 or the sound source number determined in the sound search process described later with reference to FIG. 17 is i, the CPU 11 reads a note corresponding to the i-th sound source from the table ( In step S503), a note to be pronounced can be obtained.

次に、CPU11は、図7のステップS79又はS80で判定されたヨー方向補正モードをチェックする(ステップS504)。ヨー方向補正モードが地磁気モードである場合、CPU11は、ノートイベント生成処理を終了する。他方、ヨー補正モードがショットモードである場合、CPU11は、音源とスティック部10とがなすヨー角エラーを求める(ステップS505)。具体的には、CPU11は、スティックの方向ベクトルは姿勢パラメータから求め、音源の方向ベクトルは前述したワールド座標系の音源の位置情報を用い、これら2つのベクトルのXY成分からなるベクトルの角度の差がヨー角エラーとして求める。このヨー角エラーはZ軸まわりの回転エラーであるので、CPU11は、Z軸を回転軸とした回転行列を求め、この回転行列を用いて姿勢の補正をおこなう(ステップS506)。
[サウンド探索]
図17を参照して、図16のステップS502の変形例であるサウンド探索処理の詳細説明を行う。
Next, the CPU 11 checks the yaw direction correction mode determined in step S79 or S80 in FIG. 7 (step S504). When the yaw direction correction mode is the geomagnetic mode, the CPU 11 ends the note event generation process. On the other hand, when the yaw correction mode is the shot mode, the CPU 11 obtains a yaw angle error between the sound source and the stick unit 10 (step S505). Specifically, the CPU 11 obtains the direction vector of the stick from the posture parameter, uses the position information of the sound source in the world coordinate system described above as the direction vector of the sound source, and calculates the difference in the angle of the vector composed of the XY components of these two vectors. Is calculated as a yaw angle error. Since this yaw angle error is a rotation error around the Z axis, the CPU 11 obtains a rotation matrix with the Z axis as the rotation axis, and corrects the posture using this rotation matrix (step S506).
[Sound search]
With reference to FIG. 17, a detailed description will be given of a sound search process which is a modification of step S502 of FIG.

図17は、図16のステップS502の変形例であるサウンド探索処理の流れを示すフローチャートである。本処理は、図16のステップS502の処理に替えて実行される。すなわち、本処理は、図15のステップS501の処理の後に実行され、本処理のステップS613が終了すると、CPU11は、図16のステップS503に処理を移行させる。   FIG. 17 is a flowchart showing the flow of sound search processing which is a modification of step S502 of FIG. This process is executed instead of the process of step S502 in FIG. That is, this process is executed after the process of step S501 in FIG. 15. When step S613 of this process is completed, the CPU 11 shifts the process to step S503 in FIG.

まず、CPU11は、図16のステップS502と同様のサウンド探索方法にて、各サウンドマップから一番近い音源を探し出す(ステップS601)。
次に、CPU11は、探し出した音源番号iを今回の音源選択番号としてRAM15に記憶しておく(ステップS602)。続いて、CPU11は、前回の音源番号を読み出し、その音源番号の位置座標と今回の音源の位置座標とを比較する。このとき、垂直方向Z軸を除いた、X,Y座標を比較する(ステップS603)。垂直方向は本実施例では補正しない。
First, the CPU 11 searches for the closest sound source from each sound map by the sound search method similar to step S502 in FIG. 16 (step S601).
Next, the CPU 11 stores the found sound source number i in the RAM 15 as the current sound source selection number (step S602). Subsequently, the CPU 11 reads the previous sound source number, and compares the position coordinates of the sound source number with the position coordinates of the current sound source. At this time, the X and Y coordinates excluding the vertical Z-axis are compared (step S603). The vertical direction is not corrected in this embodiment.

さらに、CPU11は、同じ方位であるか否か判断し(ステップS604)、同じ方位であると判断した時は、図9のS202で求めた移動量の水平成分の値が予め決められた正の閾値より大きいかを判定する(ステップS605)。この判定がYESの場合、CPU11は、予め決められた水平方向の回転角度分スティック部10の先端方向の位置Pを正方向に回転する(ステップS606)。ステップS605での判定がNOの場合、CPU11は、閾値を−1倍した負の閾値と当該移動量の水平成分とを比較して負の閾値より小さいかを判定する(ステップS607)。この判定がYESの場合、CPU11は、予め決められた水平方向の回転角度分スティック部10の先端方向の位置Pを負方向に回転する(ステップS608)。 Further, the CPU 11 determines whether or not they have the same azimuth (step S604). When the CPU 11 determines that they have the same azimuth, the value of the horizontal component of the movement amount obtained in S202 of FIG. It is determined whether it is larger than the threshold (step S605). If the determination is YES, CPU 11 rotates the position P y of the tip end direction of the horizontal rotation angle partial stick 10 of a predetermined in the positive direction (step S606). When the determination in step S605 is NO, the CPU 11 compares the negative threshold obtained by multiplying the threshold by −1 and the horizontal component of the movement amount to determine whether the value is smaller than the negative threshold (step S607). If the determination is YES, CPU 11 rotates the position P y of the tip end direction of the horizontal rotation angle partial stick 10 of a previously determined in the negative direction (step S608).

CPU11は、このようにスティックの先端方向の方位を補正し、再度、図16のS502と同様のサウンド探索方法にて、各サウンドマップから一番近い音源を探し出す(ステップS609)。CPU11は、音源が探せたか否か判断し(ステップS610)、探せた場合(ステップS610でYESと判断された)には、新たに見つかった音源を今回の音源番号に更新しRAM15に記憶する(ステップS611)。探せなかった場合(ステップS610でNOと判断された)には、以前の音源番号が保持されることになる。   The CPU 11 corrects the azimuth in the tip direction of the stick in this way, and again searches for the closest sound source from each sound map by the sound search method similar to S502 of FIG. 16 (step S609). The CPU 11 determines whether or not a sound source has been found (step S610), and if it can be found (YES in step S610), the newly found sound source is updated to the current sound source number and stored in the RAM 15 ( Step S611). If it cannot be found (NO in step S610), the previous sound source number is held.

次に、CPU11は、次回のショットと今回のショットとの間の移動量をもとめるため、移動量の値を0にリセットする(ステップS612)。さらに、CPU11は、今回採用した音源番号を前回の音源番号としてRAM15に記憶する(ステップS613)。   Next, the CPU 11 resets the value of the movement amount to 0 in order to obtain the movement amount between the next shot and the current shot (step S612). Further, the CPU 11 stores the sound source number adopted this time in the RAM 15 as the previous sound source number (step S613).

[発音処理]
図18を参照して、発音部30において実行される発音処理について説明する。
[Pronunciation processing]
With reference to FIG. 18, the sound generation process executed in the sound generation unit 30 will be described.

図18は、発音部30において実行される発音処理の流れを示すフローチャートである。   FIG. 18 is a flowchart showing the flow of sound generation processing executed in the sound generation unit 30.

図18に示すように、発音部30のCPU31は、電源投入時において、RAM34のデータのクリア、表示部35の画面に表示された画像のクリア、音源部371のクリアなどを含むイニシャライズ処理を実行する(ステップS701)。次いで、CPU31は、スイッチ処理を実行する(ステップS702)。スイッチ処理では、例えば、入力部36のスイッチ操作にしたがって、演奏者が所望する音量ボリュウム値及び音色を特定し、RAM34に格納する。   As shown in FIG. 18, the CPU 31 of the sound generation unit 30 executes initialization processing including clearing data in the RAM 34, clearing the image displayed on the screen of the display unit 35, clearing the sound source unit 371, and the like when the power is turned on. (Step S701). Next, the CPU 31 executes a switch process (step S702). In the switch processing, for example, the volume volume value and tone color desired by the performer are specified according to the switch operation of the input unit 36 and stored in the RAM 34.

続いて、CPU31は、I/F32が、ノートオンイベントを新たに受信しているかを判断する(ステップS703)。ステップS703でYesと判断された場合には、CPU31は、この受信されたノートオンイベントに基づき、設定された音量ボリュウム値及び設定された音色の楽音の発音を音源部371に指示する処理を実行する(ステップS704)。ステップS704の処理が終了すると、CPU31は、処理をステップS702に戻す。   Subsequently, the CPU 31 determines whether the I / F 32 has newly received a note-on event (step S703). If it is determined Yes in step S703, the CPU 31 executes a process of instructing the sound source unit 371 to generate a musical tone having the set volume volume value and the set tone based on the received note-on event. (Step S704). When the process of step S704 ends, the CPU 31 returns the process to step S702.

以上、本実施形態の演奏装置1の構成及び処理について説明した。
本実施形態においては、CPU11は、加速度センサ122が検出した加速度及び角速度センサ123が検出した角速度を一定タイミング毎に取得するとともに、スティック部10の初期の静止状態において、加速度センサ122により検出された重力による加速度を含み、当該初期静止状態における姿勢パラメータをRAM15に記憶する。そして一定タイミング毎に角速度センサ123が検出した角速度に応じて、この姿勢パラメータを更新を行い、この更新された姿勢パラメータに基づいて、検出された加速度から重力方向の加速度を算出する。さらに、この算出された加速度を所定区間毎に累算し、累算された加速度を、RAM15に記憶された加速度と一致するように補正する。
よって、スティック部10を高速に動作させた場合において、重力方向を補正することで、スティック部10の姿勢推定の精度を向上させることができる。
The configuration and processing of the performance device 1 according to the present embodiment have been described above.
In the present embodiment, the CPU 11 acquires the acceleration detected by the acceleration sensor 122 and the angular velocity detected by the angular velocity sensor 123 at regular timings, and is detected by the acceleration sensor 122 in the initial stationary state of the stick unit 10. The posture parameter in the initial stationary state including the acceleration due to gravity is stored in the RAM 15. Then, the posture parameter is updated according to the angular velocity detected by the angular velocity sensor 123 at every fixed timing, and the acceleration in the gravity direction is calculated from the detected acceleration based on the updated posture parameter. Further, the calculated acceleration is accumulated for each predetermined section, and the accumulated acceleration is corrected so as to coincide with the acceleration stored in the RAM 15.
Therefore, when the stick unit 10 is operated at high speed, the accuracy of posture estimation of the stick unit 10 can be improved by correcting the direction of gravity.

また、本実施形態においては、CPU11は、スティック部10の初期の静止状態において、磁気センサ121によって、スティック部10の長手方向の軸を含めた互いに直交する3軸それぞれの方向の地磁気成分を検出し、前述の姿勢パラメータに基づいて別の3軸方向の地磁気成分に変換してRAM15に記憶する。そして、磁気センサ121が検出する各軸の地磁気成分を一定タイミング毎に取得し、取得した一定タイミング毎の各軸の地磁気成分を姿勢パラメータに基づいて、前述の異なる3軸方向の地磁気成分に変換する。さらこの変換された各地磁気成分を所定区間毎に累算し、この累算された各地磁気成分を、RAM15に記憶された各地磁気成分に一致させるように補正する。
よって、スティック部10を高速に動作させた場合において、地磁気方向を補正することで、スティック部10の姿勢推定の精度を向上させることができる。
In the present embodiment, the CPU 11 detects the geomagnetic components in the directions of the three axes orthogonal to each other including the longitudinal axis of the stick unit 10 by the magnetic sensor 121 in the initial stationary state of the stick unit 10. Then, it is converted into a geomagnetic component in another three-axis direction based on the above-mentioned posture parameter and stored in the RAM 15. Then, the geomagnetic component of each axis detected by the magnetic sensor 121 is acquired at every fixed timing, and the acquired geomagnetic component of each axis at every fixed timing is converted into the above-described different triaxial geomagnetic components based on the attitude parameter. To do. Further, the converted local magnetic component is accumulated every predetermined section, and the accumulated local magnetic component is corrected so as to coincide with the local magnetic component stored in the RAM 15.
Therefore, when the stick unit 10 is operated at high speed, the accuracy of posture estimation of the stick unit 10 can be improved by correcting the geomagnetic direction.

また、本実施形態では、CPU11は、角速度センサ123が取得した角速度の値が「閾値1」を超えた後、「閾値2」を下回った場合に、ノートオンイベントを発音部30に送信する。また、「閾値2」は、角速度センサ123が取得した角速度の値が「閾値1」を超えた後の最大値に応じた値(具体的には、当該最大値に一定比率値を乗算した値)である。
よって、発音遅延時間を考慮して本来のショットタイミングよりも一定時間前に発音タイミングを生成することで、発音の精度を向上できる。
In the present embodiment, the CPU 11 transmits a note-on event to the sound generation unit 30 when the value of the angular velocity acquired by the angular velocity sensor 123 exceeds “threshold 1” and then falls below “threshold 2”. The “threshold value 2” is a value corresponding to the maximum value after the angular velocity value acquired by the angular velocity sensor 123 exceeds the “threshold value 1” (specifically, a value obtained by multiplying the maximum value by a certain ratio value). ).
Therefore, the sound generation accuracy can be improved by generating the sound generation timing a predetermined time before the original shot timing in consideration of the sound generation delay time.

また、本実施形態では、CPU11は、角速度センサ123が取得した角速度の値が「閾値1」を超えた後、0になるまでの時間を推定し、推定された時間が「閾値5」を下回った場合に、ノートオンイベントを発音部30に送信する。
よって、発音遅延時間を考慮して本来のショットタイミングよりも一定時間前に発音タイミングを生成することで、発音の精度を向上できる。
In this embodiment, the CPU 11 estimates the time until the angular velocity value acquired by the angular velocity sensor 123 exceeds “threshold 1” and then becomes 0, and the estimated time falls below “threshold 5”. If a note-on event occurs, a note-on event is transmitted to the sound generator 30.
Therefore, the sound generation accuracy can be improved by generating the sound generation timing a predetermined time before the original shot timing in consideration of the sound generation delay time.

また、本実施形態では、CPU11は、角速度センサ123が取得した角速度に基づいてスティック部10の先端部の角速度及び角加速度を算出し、算出されたスティック部10の先端部の角速度及び角加速度に基づいて、角速度センサ123が取得した角速度の値が「閾値1」を超えた後、0になるまでの時間を推定する。
よって、角速度の値が0になるまでの時間の推定精度を向上できる。
Further, in the present embodiment, the CPU 11 calculates the angular velocity and angular acceleration of the tip portion of the stick unit 10 based on the angular velocity acquired by the angular velocity sensor 123, and calculates the calculated angular velocity and angular acceleration of the tip portion of the stick unit 10. Based on this, the time from when the value of the angular velocity acquired by the angular velocity sensor 123 exceeds the “threshold value 1” until the value becomes 0 is estimated.
Therefore, it is possible to improve the estimation accuracy of the time until the angular velocity value becomes zero.

また、本実施形態では、CPU11は、角速度センサ123が取得した角速度に基づいて、演奏操作中のスティック部10の回転軸方向を推定し、角速度センサ123が取得した角速度からスティック部10の長手方向の軸成分を除いた角速度に基づいて、スティック部10の先端部の角速度を算出し、推定された直近の回転軸方向、及び算出されたスティック部10の先端部の直近の角速度に基づいて、所定時間後のスティック部10のワールド座標系の位置を算出し、音源マップの複数の領域のうち、算出された当該位置に最も近い領域に対応する楽音のノートオンイベントを発音部30に送信する。
よって、スティック部10が斜めにスイングされた場合であっても、本来のショットタイミングでのスティック部10の位置の音色で発音できる。
In the present embodiment, the CPU 11 estimates the rotation axis direction of the stick unit 10 during performance operation based on the angular velocity acquired by the angular velocity sensor 123, and the longitudinal direction of the stick unit 10 from the angular velocity acquired by the angular velocity sensor 123. Is calculated based on the angular velocity of the tip of the stick unit 10 based on the angular velocity excluding the axial component of the A position in the world coordinate system of the stick unit 10 after a predetermined time is calculated, and a note-on event of a musical sound corresponding to a region closest to the calculated position among a plurality of regions of the sound source map is transmitted to the sound generation unit 30. .
Therefore, even when the stick unit 10 is swung obliquely, it is possible to generate sound with the timbre at the position of the stick unit 10 at the original shot timing.

また、本実施形態では、CPU11は、角速度センサ123が取得した角速度に基づいて、演奏操作中のスティック部10の回転軸方向を推定し、角速度センサ123が取得した角速度からスティック部10の長手方向の軸成分を除いた角速度に基づいて、スティック部10の先端部の角速度を算出し、推定された直近の回転軸方向、及び算出されたスティック部10の先端部の直近の角速度に基づいて、所定時間後のスティック部10のワールド座標系の位置を算出し、加速度センサ122が取得した加速度に基づいて、移動距離を算出し、算出された当該位置、及び算出された当該移動距離に基づいて、所定時間後のスティック部10のワールド座標系の位置を補正し、音源マップの複数の領域のうち、補正された当該位置に最も近い領域に対応する楽音のノートオンイベントを発音部30に送信する。
よって、スティック部10が斜めにスイングされ、かつ平行移動した場合であっても、本来のショットタイミングでのスティック部10の位置の音色で発音できる。
In the present embodiment, the CPU 11 estimates the rotation axis direction of the stick unit 10 during performance operation based on the angular velocity acquired by the angular velocity sensor 123, and the longitudinal direction of the stick unit 10 from the angular velocity acquired by the angular velocity sensor 123. Is calculated based on the angular velocity of the tip of the stick unit 10 based on the angular velocity excluding the axial component of the A position in the world coordinate system of the stick unit 10 after a predetermined time is calculated, a moving distance is calculated based on the acceleration acquired by the acceleration sensor 122, and based on the calculated position and the calculated moving distance. The position of the stick unit 10 in the world coordinate system after a predetermined time is corrected, and the area closest to the corrected position among the plurality of areas of the sound source map is corrected. Sending a note-on event of the corresponding musical tones to the sound emitting section 30.
Therefore, even when the stick unit 10 is swung obliquely and moved in parallel, sound can be generated with the tone at the position of the stick unit 10 at the original shot timing.

また、本実施形態では、CPU11は、角速度センサ123が取得した角速度に基づいて、演奏操作中のスティック部10の角速度の最大値を算出し、加速度センサ122が取得した加速度に基づいて、演奏操作中のスティック部10の加速度の最大値を算出し、算出された角速度の最大値と、加速度の最大値とに基づいて、発音する楽音の音量を制御する。
よって、仮想的な音源がワールド座標系に垂直に配置されている場合であっても、スイング動作の強さを反映して適切な音量制御が可能となる。
In the present embodiment, the CPU 11 calculates the maximum value of the angular velocity of the stick unit 10 during the performance operation based on the angular velocity acquired by the angular velocity sensor 123, and performs the performance operation based on the acceleration acquired by the acceleration sensor 122. The maximum value of the acceleration of the inside stick unit 10 is calculated, and the volume of the musical sound to be generated is controlled based on the calculated maximum value of the angular velocity and the maximum value of the acceleration.
Therefore, even when the virtual sound source is arranged perpendicular to the world coordinate system, appropriate volume control is possible reflecting the strength of the swing operation.

以上、本発明の実施形態について説明したが、実施形態は例示に過ぎず、本発明の技術的範囲を限定するものではない。本発明はその他の様々な実施形態を取ることが可能であり、さらに、本発明の要旨を逸脱しない範囲で、省略や置換など種々の変更を行うことができる。これら実施形態やその変形は、本明細書などに記載された発明の範囲や要旨に含まれると共に、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   As mentioned above, although embodiment of this invention was described, embodiment is only an illustration and does not limit the technical scope of this invention. The present invention can take other various embodiments, and various modifications such as omission and replacement can be made without departing from the gist of the present invention. These embodiments and modifications thereof are included in the scope and gist of the invention described in this specification and the like, and are included in the invention described in the claims and the equivalents thereof.

以下に、本願の出願当初の特許請求の範囲に記載された発明を付記する。
[付記1]
ユーザが保持可能な保持部材と、
前記保持部材の互いに直交する3軸それぞれの方向に生じる加速度を検出する加速度センサと、
前記直交する3軸それぞれを中心とする角速度を検出する角速度センサと、
前記角速度センサが検出した角速度に基づいて、演奏操作中の前記演奏部材の角速度の最大値を算出する第1算出手段と、
前記加速度センサが検出した加速度に基づいて、前記保持部材の加速度の最大値を算出する第2算出手段と、
前記第1算出手段により算出された前記角速度の最大値と、前記第2算出手段により算出された前記加速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御手段と、を備える、
ことを特徴とする演奏装置。
[付記2]
ユーザが保持可能な保持部材と、前記保持部材の互いに直交する3軸のそれぞれの方向に生じる加速度を検出する加速度センサと、前記直交する3軸それぞれを中心とする角速度を検出する角速度センサと、を有する演奏装置が実行する方法であって、
前記角速度センサが検出した角速度に基づいて、演奏操作中の前記演奏部材の角速度の最大値を算出する第1算出ステップと、
前記加速度センサが検出した加速度に基づいて、前記保持部材の加速度の最大値を算出する第2算出ステップと、
前記第1算出ステップにて算出された前記角速度の最大値と、前記第2算出ステップにて算出された前記加速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御ステップと、
を含む方法。
[付記3]
ユーザが保持可能な保持部材と、前記保持部材の互いに直交する3軸のそれぞれの方向に生じる加速度を検出する加速度センサと、前記直交する3軸それぞれを中心とする角速度を検出する角速度センサと、を有する演奏装置として用いられるコンピュータに、
前記角速度センサが検出した角速度に基づいて、演奏操作中の前記演奏部材の角速度の最大値を算出する第1算出ステップと、
前記加速度センサが検出した加速度に基づいて、前記保持部材の加速度の最大値を算出する第2算出ステップと、
前記第1算出ステップにて算出された前記角速度の最大値と、前記第2算出ステップにて算出された前記加速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御ステップと、
を実行させるプログラム。
The invention described in the scope of claims at the beginning of the filing of the present application will be appended.
[Appendix 1]
A holding member that can be held by the user;
An acceleration sensor that detects acceleration generated in the directions of the three axes perpendicular to each other of the holding member;
An angular velocity sensor that detects an angular velocity about each of the three orthogonal axes;
First calculating means for calculating a maximum value of the angular velocity of the performance member during a performance operation based on the angular velocity detected by the angular velocity sensor;
Second calculating means for calculating a maximum value of acceleration of the holding member based on the acceleration detected by the acceleration sensor;
Volume control means for controlling the volume of a musical tone to be generated based on the maximum value of the angular velocity calculated by the first calculation means and the maximum value of the acceleration calculated by the second calculation means. ,
A performance apparatus characterized by that.
[Appendix 2]
A holding member that can be held by a user, an acceleration sensor that detects acceleration generated in each of three orthogonal directions of the holding member, an angular velocity sensor that detects an angular velocity about each of the three orthogonal axes, A method performed by a performance device comprising:
A first calculation step of calculating a maximum value of the angular velocity of the performance member during a performance operation based on the angular velocity detected by the angular velocity sensor;
A second calculation step of calculating a maximum value of acceleration of the holding member based on the acceleration detected by the acceleration sensor;
A volume control step for controlling the volume of a musical sound to be generated based on the maximum value of the angular velocity calculated in the first calculation step and the maximum value of the acceleration calculated in the second calculation step;
Including methods.
[Appendix 3]
A holding member that can be held by a user, an acceleration sensor that detects acceleration generated in each of three orthogonal directions of the holding member, an angular velocity sensor that detects an angular velocity about each of the three orthogonal axes, In a computer used as a performance device having
A first calculation step of calculating a maximum value of the angular velocity of the performance member during a performance operation based on the angular velocity detected by the angular velocity sensor;
A second calculation step of calculating a maximum value of acceleration of the holding member based on the acceleration detected by the acceleration sensor;
A volume control step for controlling the volume of a musical sound to be generated based on the maximum value of the angular velocity calculated in the first calculation step and the maximum value of the acceleration calculated in the second calculation step;
A program that executes

1・・・演奏装置、10・・・スティック部、11・・・CPU、12・・・姿勢センサ、13・・・I/F装置、14・・・ROM、15・・・RAM、16・・・入力部、17・・・無線通信装置、18・・・LED、121・・・磁気センサ、122・・・か速度センサ、123・・・角速度センサ、30・・・発音部、31・・・CPU、32・・・I/F、33・・ROM、34・・・RAM、35・・・表示部、36・・・入力部、37・・・サウンドシステム、38・・・赤外線通信装置、371・・・音源部、372・・・オーディオ回路、373・・・スピーカ   DESCRIPTION OF SYMBOLS 1 ... Performance apparatus, 10 ... Stick part, 11 ... CPU, 12 ... Attitude sensor, 13 ... I / F device, 14 ... ROM, 15 ... RAM, 16. ..Input unit, 17... Wireless communication device, 18... LED, 121... Magnetic sensor, 122... Speed sensor, 123. ..CPU, 32 ... I / F, 33..ROM, 34 ... RAM, 35 ... display unit, 36 ... input unit, 37 ... sound system, 38 ... infrared communication Device, 371 ... Sound source unit, 372 ... Audio circuit, 373 ... Speaker

Claims (3)

ユーザが保持可能な保持部材と、
前記保持部材の互いに直交する3軸それぞれの方向に生じる加速度を検出する加速度センサと、
前記直交する3軸それぞれを中心として回転した場合に生じる角速度を検出する角速度センサと、
前記角速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる角速度に基づいて、演奏操作中の前記保持部材の角速度の最大値を取得する第1取得手段と、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の加速度の最大値を取得する第2取得手段と、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の速度の最大値を取得する第3取得手段と、
前記第1取得手段により取得された前記角速度の最大値と、前記第2取得手段により取得された前記加速度の最大値と、前記第3取得手段により取得された前記速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御手段と、を備える、
ことを特徴とする演奏装置。
A holding member that can be held by the user;
An acceleration sensor that detects acceleration generated in the directions of the three axes perpendicular to each other of the holding member;
An angular velocity sensor that detects an angular velocity that occurs when rotating about each of the three orthogonal axes;
First acquisition means for acquiring a maximum value of the angular velocity of the holding member during a performance operation based on an angular velocity generated corresponding to the swing-down operation of the holding member detected by the angular velocity sensor;
Second acquisition means for acquiring a maximum acceleration value of the holding member based on an acceleration generated in response to a swing-down operation of the holding member detected by the acceleration sensor;
Third acquisition means for acquiring a maximum value of the speed of the holding member based on acceleration generated in response to the swing-down operation of the holding member detected by the acceleration sensor;
Based on the maximum value of the angular velocity acquired by the first acquisition unit, the maximum value of the acceleration acquired by the second acquisition unit, and the maximum value of the velocity acquired by the third acquisition unit. Volume control means for controlling the volume of the musical sound to be generated,
A performance apparatus characterized by that.
ユーザが保持可能な保持部材と、前記保持部材の互いに直交する3軸のそれぞれの方向に生じる加速度を検出する加速度センサと、前記直交する3軸それぞれを中心として回転した場合に生じる角速度を検出する角速度センサと、を有する演奏装置が実行する方法であって、
前記角速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる角速度に基づいて、演奏操作中の前記保持部材の角速度の最大値を取得する第1取得ステップと、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の加速度の最大値を取得する第2取得ステップと、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の速度の最大値を取得する第3取得ステップと、
前記第1取得ステップにて取得された前記角速度の最大値と、前記第2取得ステップにて取得された前記加速度の最大値と、前記第3取得ステップにより取得された前記速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御ステップと、
を含む方法。
A holding member that can be held by a user, an acceleration sensor that detects acceleration generated in each of the three orthogonal axes of the holding member, and an angular velocity that is generated when the user rotates about each of the three orthogonal axes. A method performed by a performance device having an angular velocity sensor,
A first acquisition step of acquiring a maximum value of the angular velocity of the holding member during a performance operation based on an angular velocity generated corresponding to the swing-down operation of the holding member detected by the angular velocity sensor;
A second acquisition step of acquiring a maximum value of the acceleration of the holding member based on an acceleration generated in response to the swing-down operation of the holding member detected by the acceleration sensor;
A third acquisition step of acquiring a maximum value of the speed of the holding member based on an acceleration generated in response to the swing-down operation of the holding member detected by the acceleration sensor;
The maximum value of the angular velocity acquired in the first acquisition step, the maximum value of the acceleration acquired in the second acquisition step, and the maximum value of the velocity acquired in the third acquisition step. Based on the volume control step for controlling the volume of the musical sound to be generated,
Including methods.
ユーザが保持可能な保持部材と、前記保持部材の互いに直交する3軸のそれぞれの方向に生じる加速度を検出する加速度センサと、前記直交する3軸それぞれを中心として回転した場合に生じる角速度を検出する角速度センサと、を有する演奏装置として用いられるコンピュータに、
前記角速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる角速度に基づいて、演奏操作中の前記保持部材の角速度の最大値を取得する第1取得ステップと、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の加速度の最大値を取得する第2取得ステップと、
前記加速度センサが検出した前記保持部材の振り下ろし動作に対応して生じる加速度に基づいて、前記保持部材の速度の最大値を取得する第3取得ステップと、
前記第1取得ステップにて取得された前記角速度の最大値と、前記第2取得ステップにて取得された前記加速度の最大値と、前記第3取得ステップにより取得された前記速度の最大値とに基づいて、発音する楽音の音量を制御する音量制御ステップと、
を実行させるプログラム。
A holding member that can be held by a user, an acceleration sensor that detects acceleration generated in each of the three orthogonal axes of the holding member, and an angular velocity that is generated when the user rotates about each of the three orthogonal axes. In a computer used as a performance device having an angular velocity sensor,
A first acquisition step of acquiring a maximum value of the angular velocity of the holding member during a performance operation based on an angular velocity generated corresponding to the swing-down operation of the holding member detected by the angular velocity sensor;
A second acquisition step of acquiring a maximum value of the acceleration of the holding member based on an acceleration generated in response to the swing-down operation of the holding member detected by the acceleration sensor;
A third acquisition step of acquiring a maximum value of the speed of the holding member based on an acceleration generated in response to the swing-down operation of the holding member detected by the acceleration sensor;
The maximum value of the angular velocity acquired in the first acquisition step, the maximum value of the acceleration acquired in the second acquisition step, and the maximum value of the velocity acquired in the third acquisition step. Based on the volume control step for controlling the volume of the musical sound to be generated,
A program that executes
JP2012084373A 2012-04-02 2012-04-02 Performance device, method and program Active JP6031801B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012084373A JP6031801B2 (en) 2012-04-02 2012-04-02 Performance device, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012084373A JP6031801B2 (en) 2012-04-02 2012-04-02 Performance device, method and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2016208409A Division JP6436145B2 (en) 2016-10-25 2016-10-25 Performance device, method and program

Publications (3)

Publication Number Publication Date
JP2013213948A JP2013213948A (en) 2013-10-17
JP2013213948A5 JP2013213948A5 (en) 2015-05-21
JP6031801B2 true JP6031801B2 (en) 2016-11-24

Family

ID=49587315

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012084373A Active JP6031801B2 (en) 2012-04-02 2012-04-02 Performance device, method and program

Country Status (1)

Country Link
JP (1) JP6031801B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011128427A (en) * 2009-12-18 2011-06-30 Yamaha Corp Performance device, performance control device, and program
JP2012013725A (en) * 2010-06-29 2012-01-19 Casio Comput Co Ltd Musical performance system and electronic musical instrument
JP5668353B2 (en) * 2010-08-02 2015-02-12 カシオ計算機株式会社 Performance device and electronic musical instrument

Also Published As

Publication number Publication date
JP2013213948A (en) 2013-10-17

Similar Documents

Publication Publication Date Title
JP6044099B2 (en) Attitude detection apparatus, method, and program
JP2013213946A (en) Performance device, method, and program
JP2013213744A (en) Device, method and program for detecting attitude
US8609972B2 (en) Performance apparatus and electronic musical instrument operable in plural operation modes determined based on movement operation of performance apparatus
US8445769B2 (en) Performance apparatus and electronic musical instrument
CN102568453B (en) Performance apparatus and electronic musical instrument
US8445771B2 (en) Performance apparatus and electronic musical instrument
US8710347B2 (en) Performance apparatus and electronic musical instrument
JP6436145B2 (en) Performance device, method and program
JP6031801B2 (en) Performance device, method and program
JP6519578B2 (en) Posture detection apparatus and posture detection method
JP6031800B2 (en) Performance device, method and program
JP2011252994A (en) Performance device and electronic music instrument
JP2013213947A (en) Performance device, method, and program
JP2013044889A (en) Music player
JP2013195625A (en) Musical sound generating device
JP2012013725A (en) Musical performance system and electronic musical instrument
JP2013044951A (en) Handler and player
JP2012032681A (en) Performance device and electronic musical instrument

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150401

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150401

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160223

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160422

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161010

R150 Certificate of patent or registration of utility model

Ref document number: 6031801

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150