This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2012-084368, filed Apr. 2, 2012, the entire contents of which is incorporated herein by reference.
1. Field of the Invention
The present invention relates to an orientation detection device, an orientation detection method and a program storage medium.
2. Description of the Related Art
Conventionally, a musical performance device has been proposed which detects the playing motion of an instrument player and emits a sound corresponding to the playing motion. For example, a musical performance device is known which emits a percussion sound with a structure only including a drumstick-shaped member. In this musical performance device, a sensor is provided to its drumstick-shaped member. When the instrument player holds and swings the member by hand, the sensor detects the playing motion, and a percussion sound is emitted.
With this virtual musical performance device, a musical sound of a musical instrument can be emitted without requiring a real musical instrument, and therefore the instrument player can enjoy playing without restriction on a playing place or a playing space.
As a virtual musical performance device as described above, for example, Japanese Patent Application Laid-Open (Kokai) Publication No. 2007-256736 discloses a musical performance device which is structured such that an acceleration sensor is provided to a drumstick-shaped member, and emits a musical sound after an output (an acceleration value) obtained from the acceleration sensor by shaking the member reaches a predetermined threshold.
Meanwhile, in the virtual musical performance device, a different musical sound is often provided for each different playing motion of an instrument player. Also in the configuration of the musical performance device disclosed in Japanese Patent Application Laid-Open (Kokai) Publication No. 2007-256736, a geomagnetic sensor is used to determine the orientation of the drumstick-shaped member and a musical sound of a different timbre can be emitted according to the orientation. In this case, however, since a sound source can be placed only in a horizontal direction, the maximum number of sound sources is three or four, and sound sources more than this cannot be placed.
As a method of solving this problem, sound sources can be placed according to an angle with respect to a gravity direction by using an acceleration sensor. Although gravity can be sensed by the acceleration sensor, gravity is combined with an external force to become a resultant force, and therefore the gravity direction cannot be specified when the drumstick is moved at high speed. Thus, accuracy of drumstick orientation estimation is degraded.
The present invention has been conceived in light of the above-described problems. An object of the present invention is to provide an orientation detection device which corrects a gravity direction when a drumstick-shaped member is moved at high speed, and thereby improves accuracy in estimating the orientation of a drumstick-shaped member.
In accordance with one aspect of the present invention, there is provided an orientation detection device comprising: a holding member which is operated by a user; an acceleration sensor which detects acceleration occurring in each direction of three axes of the holding member which are orthogonal to each other; an angular velocity sensor which detects angular velocity centering on each of the three axes which are orthogonal to each other; an obtainment section which obtains the acceleration detected by the acceleration sensor and the angular velocity detected by the angular velocity sensor at every predetermined timing; a storage control section which stores in memory an orientation parameter in an initial stationary state including acceleration by gravity detected by the acceleration sensor in the initial stationary state of the holding member; an update section which updates the orientation parameter stored in the memory according to a value of the angular velocity obtained when the angular velocity is detected; a calculation section which calculates acceleration in a gravity direction from the detected acceleration based on the updated orientation parameter; an accumulation section which accumulates the calculated accelerations; and a correction section which corrects the orientation parameter so that acceleration obtained by accumulation by the accumulation section conforms to initial acceleration stored in the memory.
The above and further objects and novel features of the present invention will more fully appear from the following detailed description when the same is read in conjunction with the accompanying drawings. It is to be expressly understood, however, that the drawings are for the purpose of illustration only and are not intended as a definition of the limits of the invention.
Hereafter, embodiments of the present invention are described using the drawings.
An embodiment of the present invention is described below with reference to the attached drawings.
The drumstick section 10 is a drumstick-shaped member extending in a longitudinal direction. An instrument player performs a playing motion by holding one end (a bottom side) of the drumstick section 10 and performing upswing and downswing motions centering on his or her wrist or the like. To detect this playing motion of the instrument player, an orientation sensor 12 is provided at the other end (a tip side) of the drumstick section 10 (refer to
The sound emitting section 30 emits a musical sound.
In the musical performance device 1, according to a playing motion using the drumstick section 10, that is, the downswing motion of the drumstick section 10, the sound emitting section 30 emits a predetermined musical sound. With this, music is played by the instrument player.
[Structure of Musical Performance Device 1]
First, with reference to
[Structure of Drumstick Section 10]
The orientation sensor 12 includes a triaxial magnetic sensor 121 which measures a geomagnetic direction, a triaxial acceleration sensor 122 for measuring acceleration added to the drumstick, and a triaxial angular velocity sensor 123 which measures a rotating motion of the drumstick. Each sensor can measure three axes x, y, and z each in an axial direction.
With reference to
Here, the instrument player holds the one end (on the bottom side) of the drumstick section 10, performs upswing and downswing motions centering on his or her wrist or the like, and thereby causes the drumstick section 10 to perform a rotating motion, a parallel motion, or the like. These motions are detected by the orientation sensor 12 and sent to the CPU 11.
Referring back to
As such, the CPU 11 transmits a note-on event to the sound emitting section 30 based on each sensor value of the orientation sensor 12 included in the drumstick section 10, and thereby allows the sound emitting section 30 to emit a predetermined musical sound based on the playing motion using the drumstick section 10.
The ROM 14 has stored therein processing programs for a variety of processing to be performed by the CPU 11, that is, as described above, data obtainment by the orientation sensor 12, note-on event generation processing, note-on event transmission processing and the like. The RAM 15 has stored therein each sensor value of the orientation sensor 12 and values obtained or generated in processing. The I/F device 13 outputs data to the wireless communication device 17 according to an instruction from the CPU 11.
The input section 16 has various switches (not shown), accepting various instruction inputs from the instrument player.
The wireless communication device 17 performs a predetermined wireless communication with the sound emitting section 30. The predetermined wireless communication may be performed with any method. In the present embodiment, the wireless communication device 17 performs a wireless communication with the sound emitting section 30 via an infrared communication. The LED 18 lights up and out according to the control from the CPU 11. The LED 18 is used to indicate a processing state of the drumstick, such as initialization of the drumstick orientation.
[Structure of Sound Emitting Section 30]
Next, the structure of the sound emitting section 30 is described with reference to
The CPU 31 performs a variety of processing, such as control over the entire musical performance device 1, in particular, control over the sound emitting section 30, detection of operation of a key switch (not shown) constituting the input section 36, and musical sound emission based on a note-on event from the drumstick section 10 received via the I/F 32.
The ROM 33 has stored therein various programs for processing, such as control over the entire musical performance device 1, in particular, control over the sound emitting section 30, detection of operation of the key switch (not shown) configuring the input section 36, and musical sound emission based on a note-on event received via the I/F 32. The ROM 33 includes a waveform data area for storing waveform data of various timbres, for example, those of wind instruments such as flutes, saxophones, and trumpets; keyboard instruments such as pianos; stringed instruments such as guitars; and percussion instruments such as bass drums, high-hats, snare drums, cymbals, and tamtams.
The RAM 34 stores a program read from the ROM 33 and data and parameters occurring in the course of processing. The data occurring in the course of processing includes those of an operation state of each switch of the input section 36, a note-on even received via the I/F 32, and the status of a body motion of the instrument player (such as an advance flag or a displacement amount).
The display section 35 is constituted by, for example, a liquid-crystal display device, and displays a selected timbre, a selected sound volume, the state of the body motion of the instrument player (a displacement amount from a reference position), and the like as images. The input section 36 has various switches (not shown), and accepts inputs of a variety of information from the instrument player.
The sound system 37 includes the sound source section 371, an audio circuit 372, and a loudspeaker 373. The sound source section 371 reads waveform data from the waveform data area of the ROM 33 by following an instruction from the CPU 31 to generate musical sound data for output. The audio circuit 372 converts musical sound data outputted from the sound source section 371 to an analog signal, and amplifies and outputs the analog signal obtained by conversion to the loudspeaker 373. With this, a musical sound is outputted from the loudspeaker 373.
[Description of Coordinate System]
Next, the orientation of the drumstick and a world coordinate system in the present embodiment are described with reference to
When the drumstick section 10 moves, the origin of the local coordinate system when viewed from the origin of the world coordinate system also moves. The origin of the local coordinate system when viewed from the world coordinate system is referred to as a position of the drumstick section 10.
[Processing of Musical Performance Device 1]
Next, processing of the musical performance device 1 of the present embodiment is described. First, the processing to be performed in the drumstick section 10 is briefly described with reference to
First, the CPU 11 performs initialization processing including initialization of various sensors included in the orientation sensor 12 and clearing of data in the RAM 15 (Step S11). When the initialization processing ends, the CPU 11 adjusts offset, gain, and the like which change due to device variations and temperature of various sensors included in the orientation sensor 12 (Step S12). Next, the CPU 11 reads the status of the switches of the input section 36 and stores the status in the RAM 15 (Step S14). The status of the switches stored in the RAM 15 is used, for example, for assisting position detection, which will be described further below.
Next, when the user swings the drumstick section 10, the CPU 11 performs processing for emitting a sound according to the swing (Steps S16 to S24). First, the CPU 11 stores an acceleration value and an angular velocity value of the orientation sensor 12 and direction and intensity of geomagnetism in the RAM 15 (Step S16).
According to the read values, the CPU 11 estimates the orientation of the drumstick section 10 (Step S17), and then estimates the position in translation of the drumstick section 10 (Step S18). Furthermore, the CPU 11 predicts the motion of the tip of the drumstick section 10 (Step S19), and detects sound emission timing by using the predicted motion (Step S20). Still further, the CPU 11 detects a sound emission amount (Step S21). When sound emission timing is detected (when the motion state is “SHOT”, which will be described further below) at Step S20 (when a judgment result at Step S22 is YES), the CPU 11 determines a timbre and pitch of a musical sound according to the orientation and position of the drumstick section 10 and generates a note-on event (Step S23), and transmits the generated note-on event to the sound emitting section 30 (Step S24).
[Initialization of Orientation Sensor and Orientation]
With reference to
First, the CPU 11 performs display so as to ask the user to stay stationary with the tip of the drumstick section 10 oriented in a forward direction (Step S71). In a display example, the CPU 11 causes the LED 18 to light up in green.
Next, the CPU 11 reads data of each axis of the angular velocity sensor 123. In the angular velocity sensor 123, due to device variations and temperature fluctuations, an offset value normally fluctuates when the angular velocity is 0. The CPU 11 stores the value of the angular velocity sensor 123 in the RAM 15 as an offset value (Step S72). In the following steps, when reading the value of the angular velocity sensor 123, the CPU 11 subtracts the offset value from the read value, and thereby adjusts the angular velocity to 0 when the drumstick section 10 stays stationary.
Next, the CPU 11 reads data of each axis of the acceleration sensor 122 to compare the read data with the previous acceleration, and thereby judges whether a change in a gravity direction has been detected (Step S74). Specifically, when the drumstick section 10 is in a stationary state, the value of the acceleration sensor 122 only indicates each axis component in the gravity direction. Therefore, if the value of each axis component has not been changed, the CPU 11 can detect that the drumstick is in a stationary state. In the present embodiment, the CPU 11 detects that the drumstick is in a stationary state if there is no change for approximately one second. When the drumstick is detected to be in a stationary state, the CPU 11 completes registration of the offset value of the angular velocity, and proceeds to Step S75. On the other hand, when the drumstick is detected to have been moved, the CPU 11 proceeds to Step S72, and again registers the offset value.
Subsequently, the CPU 11 initializes the orientation (Step S75). Specifically, the CPU 11 initializes the relation between the world coordinate system and the local coordinate system such that, with the user orienting the tip of the drumstick section 10 in a forward direction, the direction in which the tip of the drumstick section 10 is oriented is the front direction of the world coordinate system (in Y axis direction). The CPU 11 also stores each axis component of angular velocity, acceleration, and geomagnetism at the time of initialization in the RAM 15.
Subsequently, the CPU 11 performs display for causing the user to orient the drumstick section 10 in various directions (Step S76). For example, the CPU 11 causes the LED 18 to light up in red.
Furthermore, the CPU 11 finds an offset and gain correction data of the magnetic sensor 121 (Step S77). Specifically, in response to the processing at Step S76, the CPU 11 causes the magnetic sensor 121 to measure geomagnetic values when the user orients the drumstick section 10 in various directions, and thereby finds correction data by using the geomagnetic values obtained by measurement. As an example of how to find offset and gain values, the CPU 11 calculates a median value from a maximum value and a minimum value of each axis of the magnetic sensor 121, and sets the calculated median value as an offset value of each axis.
Also, the CPU 11 calculates a gain correction value so that values from the center to the maximum value in the respective axes are equal, and stores the calculated offset value and the gain correction value in the RAM 15. At the following steps, when a value of the magnetic sensor 121 is read out, the CPU 11 subtracts the offset value from the read value and multiplies the resultant value by the correction gain to correct the geomagnetic value and sets the corrected value as a detection value.
Subsequently, the CPU 11 judges whether the detected geomagnetic value is a value to be detected on the ground in general (Step S78). When the detected geomagnetic value is not a value to be detected on the ground in general, the CPU 11 returns to Step S76, and again finds an offset value and a gain correction data of the magnetic sensor 121. When the detected geomagnetic value is a value to be detected on the ground in general, the CPU 11 proceeds to Step S79, and sets a yaw correction mode to a geomagnetic mode.
Also, when the detected geomagnetic value is not a value to be detected on the ground in general even if the processing at Step S78 is repeated at a predetermined number of times (for example, five times), the CPU 11 proceeds to Step S80, and sets a yaw correction mode to a shot mode. When the processing at Step S79 or Step S80 ends, the CPU 11 proceeds to Step S81, and performs display indicating whether the yaw correction mode is a geomagnetic mode or a shot mode. For example, the CPU 11 causes the LED 18 to light up in red in the case of the shot mode, and causes the LED 18 to light up in green in the case of the geomagnetic mode. The sensor value correction processing of the angular velocity sensor 123 and that of the magnetic sensor 121 may change places in an order.
[Orientation Estimation]
With reference to
With base vectors of the x axis, the y axis, and the z axis of the local coordinate system when viewed from the world coordinate system as ex, ey, and ez to define a matrix TL→W(exeyez) having the respective base vectors arranged in columns, the following relational expressions 1 and 2 holds between a point p=(xyz)T in the local coordinate system and a point P=(XYZ)T in the world coordinate system corresponding to the point p (operator T refers to a transposed matrix):
P=TL→Wp Equation 1
and
p=TL→WTP Equation 2.
As such, since TL→W indicates the relation between the two coordinate systems, the current drumstick orientation state can be represented by using the relation between the two coordinate systems and the like. As an orientation representing method, an angle of pitch, yaw, roll, or the like may be used.
Meanwhile, from the value of the angular velocity sensor 123 read at a current time t, a ternary vector having the respective axis components in the local coordinate system can be obtained. By multiplying the value of each axis component of the ternary vector by δT, which is a sampling time of the angular velocity sensor 123, a rotation angle vector θt=(θxtθytθzt)T can be found.
With this rotation angle vector, the orientation of the drumstick can be found. Specifically, by using a resultant matrix Rall(θt) of rotation of θxt about the x axis, rotation of θyt about the y axis, and rotation of θzt about the z axis and a previous orientation TL→Wt−1, a orientation TL→Wt can be estimated as TL→Wt=Rall(θt)TL→Wt−1. As such, the CPU 11 updates the previous orientation to estimate the current orientation based on the current values of the angular velocity sensor 123 (Step S101).
However, in the orientation found as described above, errors accumulate. Also, once the orientation has an error, accuracy of orientation estimation thereafter is significantly degraded. For example, consider that the drumstick section 10 is rotated from a forward horizon straight toward a right horizon. First, if an error occurs in the rotation not in a horizontal direction but in a vertical direction, the drumstick rotates with the trajectory of the tip of the drumstick diagonally rising upward. Then, a new rotation is added again to the orientation, and therefore the orientation becomes shifted at an accelerated rate from a proper orientation. Therefore, orientation estimation is corrected by performing gravity estimation, and thereby increases orientation accuracy.
An acceleration vector detected by the acceleration sensor 122 includes components of the respective axes in the local coordinate system. This acceleration vector is represented by a world coordinate system vector by using orientation information found at Step S101.
If no external force is added, the acceleration sensor 122 only detects gravity. Therefore, when the acceleration vector in the local coordinate system detected by the acceleration sensor 122 is converted to a vector in the world coordinate system, the vector always indicates the same direction. However, since an external force such as a centrifugal force is added during the motion of the drumstick section 10, the vector is not necessarily always oriented to the same direction. However, since the user swings the drumstick section 10 as being in a stationary state, the position of the drumstick section 10 does not move. Moreover, the velocity becomes 0 in many cases such as the drumstick section 10 is swung upward or downward. That is, an integral of the external force obtained by excluding a gravity component from the acceleration vector becomes 0 in many cases. Thus, the vector obtained by integrating the acceleration vector in the world coordinate system approximately indicates a gravity direction. By using this property, the gravity direction of the world coordinate system is estimated.
Specifically, the acceleration value of each axis component obtained by the acceleration sensor 122 read at the current time t is taken as LAT=(AxtAytAzt)T, and since this acceleration value is in the local coordinate system, the CPU 11 carries out a calculation by conversion to the world coordinate system based on Equation 3 (Step S102):
WAT=TL→Wt′LAT Equation 3
Next, for each component regarding the acceleration vector obtained by conversion to the world coordinate system, the CPU 11 calculates an average value from the current time to a predetermined time to find an average acceleration vector. The predetermined time is experimentally determined based on the swing state or the like. The CPU 11 estimates this average acceleration vector as a gravity direction vector Wegt (Step S103).
Specifically, the following Equation 4 is defined, and accumulation is performed by recursive addition. Kg is a damping coefficient, and is experimentally determined based on the swing state or the like:
Gwt=kg·Gwt−1+WAt Equation 4.
From Gwt, the gravity direction vector we % in the world coordinate system is estimated by Wegt=Gwt/|Gwt|.
Next, the CPU 11 corrects the orientation parameter TL→Wt so that the gravity direction vector Wegt becomes a negative direction vector (0 0 −1)T on the z axis (Step S104). Specifically, the CPU 11 performs operation for rotation about an axis orthogonal to these two vectors, that is, the gravity direction vector Wegt and the negative direction vector (0 0 −1)T by an angle formed therebetween, and thereby corrects the orientation parameter TL→Wt. With this, a correction in the gravity direction is made, whereby accuracy of orientation estimation is improved.
Since the orientation is corrected as described above only in the gravity direction, error accumulations in a yaw angle centering on the Z axis are left. The present embodiment suggests two methods to correct the yaw angle, that is, a switch operation by the user and a correction using geomagnetism.
First, a correction by a switch operation by the user is described. In this correction, a correction is made by the CPU 11 to the yaw angle by the user regularly pushing the input section 16 (for example, a switch) included in the drumstick section 10 at timing when the drumstick section 10 is oriented upward. The CPU 11 judges whether a yaw direction forcible switch has been turned ON (Step S109). In this processing, the CPU 11 judges whether a signal has been received that indicates that the yaw direction forcible switch has been turned ON.
If the judgment result at Step S109 is YES, the CPU 11 finds a rotation matrix that conforms a direction vector of the tip of the drumstick section 10 in the world coordinate system to a Y-axis direction vector in the world coordinate system and, by using this rotation matrix, corrects the orientation parameter (Step S110). With this, the yaw angle of the tip of the drumstick section 10 is set at 0 degree.
In this rotation matrix, consider a rotation angle vector having a length of an angle formed by two vectors and oriented to a vector direction orthogonal to these two vectors. For this rotation angle vector, a conversion can be made to find a resultant matrix by using the same method as that for finding a resultant rotation matrix for the orientation correction of the angular velocity sensor 123.
Next, correction using geomagnetism is described.
When the judgment result at Step S109 is NO, the CPU 11 judges whether the yaw direction correction mode is a correction mode in a geomagnetic mode (Step S105). If the mode is not a correction mode in a geomagnetic mode, the CPU 11 ends the orientation estimation processing.
If the mode is a correction mode in a geomagnetic mode, the CPU 11 takes the value of the geomagnetic vector found from the magnetic sensor 121 and read at the current time t as LMT=(MxtMytMzt)T. Since this value is in the local coordinate system, the CPU 11 makes a conversion to the world coordinate system based on Equation 5 (Step S106):
WMT=TL→Wt′LMT Equation 5.
Next, for example, the CPU 11 performs smoothing by executing an IIR (Infinite Impulse Response) filter. A direction obtained by smoothing is estimated as a current geomagnetic direction Wemt (Step S107).
Specifically, the following IIR filter operation (Equation 6) is performed for smoothing. km is a filter coefficient experimentally determined based on a swing state or the like.
Mwt=(1−km)·Mwt−1+km′WAt Equation 6.
From Mwt, the geomagnetic direction vector Wemt in a world coordinate system is estimated by Wemt=MWt/|Mwt|.
Subsequently, the CPU 11 records a geomagnetic direction Wem0 in the world coordinate system at an initial state in the RAM 15, finds a rotation matrix so that the current geomagnetic direction Wemt and the geomagnetic direction Wem0 in the world coordinate system at the initial state are oriented to the same direction on an XY plane in the world coordinate system, and makes a correction of the orientation parameter TL→Wt by using the rotation matrix (Step S108). With this, a correction in the geomagnetic direction is performed, and therefore accuracy of orientation estimation is improved.
Specifically, consider vectors with a Z component of each vector being set at 0. Also, from these two vector directions, as with gravity correction, consider a vector oriented to a vector direction orthogonal to these two vectors and having a length at an angle formed by the two vectors. The rotation matrix described above can be represented with conversion to a resultant matrix of rotations of the values of the respective components of these vectors.
[Position Estimation]
With reference to
At orientation estimation, at Step S103 of
Since complete integral has an influence of error accumulation, incomplete integral is desirably used. A damping coefficient (a time constant) is adjusted by experiment. Thus found values are used in subsequent note event generation processing (refer to
[Tip Motion Prediction]
With reference to
The magnitude of sound emission is desirably controlled with the velocity of the tip of the drumstick. In a velocity prediction method, the velocity is found from the acceleration sensor, but there is a problem in accuracy. Moreover, since the user swings the drumstick with a rotating motion centering on the elbow or shoulder or as extending the elbow, only the angular velocity is not enough, and the angular velocity and the velocity may not have a proportional relation. For this reason, in the present embodiment, the velocity is predicted by using the angular velocity and angular acceleration of the tip.
As an example of calculating the angular velocity and angular acceleration, the CPU 11 first takes angular velocity obtained by excluding components about the y axis from the angular velocity vector as an observation value ωVt=(ωxt0 ωzt)T of the angular velocity of the tip of the drumstick, and uses a Kalman filter or the like to estimate the value as angular velocity ωs and angular acceleration δωs (Step S210).
For example, each angular velocity component can be calculated by adding an angular velocity component to the previous angular velocity component, and each angular acceleration component can be calculated by using a state model in which drive noise is added to the same angular acceleration component as the previous one. By using the angular velocity of the tip of the drumstick obtained as described above, the CPU 11 estimates the most recently averaged vector direction of the angular velocity as a drumstick tip velocity rotation axis er (Step S211).
While estimation is achieved by using the Kalman filter in the present embodiment, an IIR filter may be used to smooth the values of the respective sensors and a difference therebetween to calculate angular velocity and angular acceleration.
A direction orthogonal to the drumstick tip rotation axis and the direction y axis of the drumstick (an outer product direction, refer to
[Sound Emission Timing Detection Processing]
With reference to
[Sound Emission Timing Detection Processing (First Example)]
First, the processing of the CPU 11 branches off according to the motion state (Step S302). There are four motion states: IDLE, ACTION, SHOT, and DONE. When the motion state is IDLE, the CPU 11 proceeds to Step S303. When the motion state is ACTION, the CPU 11 proceeds to Step S320. When the motion state is SHOT, the CPU 11 proceeds to Step S330. When the motion state is DONE, the CPU 11 proceeds to Step S340.
Here, standard transitions of the motion state are depicted in
IDLE represents a state in which the drumstick is stationary, and the motion state in an initial state has been initialized to IDLE. At a time t0 in the initial state, the motion state is IDLE. Here, the CPU 11 ends the sound emission timing detection processing when the angular acceleration of the drumstick section 10 is not positive (Step S303). Even if the angular acceleration of the drumstick section 10 is positive, when the angular velocity of the drumstick section 10 is equal to or smaller than “Threshold 1”, the CPU 11 ends the sound emission timing detection processing (Step S304). When the angular velocity of the drumstick section 10 exceeds “Threshold 1”, the CPU 11 proceeds to Step S305 (Step S304).
When the motion state becomes ACTION, the drumstick continues accelerating for the time being, during which the angular acceleration is positive. Therefore, the judgment result at Step S320 is YES, and the CPU 11 compares the current angular velocity with the retained maximum angular velocity (Step S321). When the angular velocity is larger than the maximum angular velocity, the CPU 11 updates the maximum angular velocity (Step S322) to update “Threshold 2” (Step S323). If the angular velocity is smaller than the maximum angular velocity, the CPU 11 ends the sound emission timing detection processing.
“Threshold 2” is determined based on the value of the maximum angular velocity. For example, “Threshold 2” is found as “Threshold 2”=(Maximum Angular Velocity)×C, where C is experimentally determined from a value of 0 to 1, and desirably on the order of 0.1 in a normal case. In “Threshold 2”, a previous angular velocity corresponding to a delay time from the time when a shot is detected to the time when a sound is emitted is assumed. This is because, due to the occurrence of a delay in wireless transmission or a delay in sound emission processing which will be described further below, in order to compensate for the delay, a sound is emitted before timing at which a sound is supposed to be emitted. In general, it is assumed that the curve of the angular velocity of the shot is proportional to the intensity of a sound, and the threshold is determined based on the maximum value of the angular velocity.
When the drumstick section 10 is changed to be in a deceleration state (t3), the angular acceleration of the drumstick section 10 becomes 0 or smaller, and therefore the judgment result at Step S320 is NO. At Step S324, the CPU 11 compares an absolute value of the current angular velocity with “Threshold 2” to see whether the absolute value is smaller than “Threshold 2”. While the drumstick is not being sufficiently decelerated, the judgment result at Step S324 is NO, and the CPU 11 ends the sound emission timing detection processing and wait for shot timing.
If the drumstick has been decelerated sufficiently and the absolute value of the current angular velocity becomes smaller than “Threshold 2”, the CPU 11 determines that shot timing is coming near, judges that the judgment result at Step S324 is YES (at a timing of t4), sets the motion state to SHOT (Step S325), and then initializes a shot passage time to 0 (Step S326). Then, the CPU 11 ends the sound emission timing detection processing. This SHOT state is to make a notification of sound emission timing, and is used to determine sound emission timing at Step S22 of
When the motion state is SHOT, the CPU 11 updates the motion state to DONE at Step S330, and then ends the sound emission timing detection processing.
When the motion state is DONE, the CPU 11 judges whether the angular velocity is equal to or smaller than “Threshold 3” (Step S340). When judged that the angular velocity is equal to or smaller than “Threshold 3”, the CPU 11 changes the motion state to IDLE (Step S341) and ends the sound emission timing detection processing. When judged that the angular velocity is larger than “Threshold 3” at Step S340, the CPU 11 judges whether the shot passage time is equal to or smaller than “Threshold 4” (Step S342). When judged that the shot passage time is equal to or smaller than “Threshold 4”, the CPU 11 ends the sound emission timing detection processing. On the other hand, when judged that the shot passage time has exceeded “Threshold 4”, the CPU 11 changes the motion state to IDLE (Step S341), and ends the sound emission timing detection processing.
That is, the DONE state is held until the angular velocity becomes equal to or smaller than “Threshold 3”. This is to prevent an erroneous operation such as emission of a plurality of sounds at the time of stopping. However, if the angular velocity is gradually decelerated and the shot passage time until the angular velocity becomes equal to or smaller than “Threshold 3” exceeds “Threshold 4”, the motion state is changed from DONE to IDLE.
[Sound Emission Timing Detection Processing (Second Example)]
First, the processing of the CPU 11 branches off according to the motion state (Step S352). There are four motion states: IDLE, ACTION, SHOT, and DONE. When the motion state is IDLE, the CPU 11 proceeds to Step S353. When the motion state is ACTION, the CPU 11 proceeds to Step S370. When the motion state is SHOT, the CPU 11 proceeds to Step S380. When the motion state is DONE, the CPU 11 proceeds to Step S390. Here, standard transitions of the motion state are similar to those of the first example as depicted in
When the angular acceleration of the drumstick section 10 is not positive, the CPU 11 ends the sound emission timing detection processing (Step S353). Even if the angular acceleration of the drumstick section 10 is positive, when the angular velocity of the drumstick section 10 is equal to or smaller than “Threshold 1”, the CPU 11 ends the sound emission timing detection processing (Step S354). When the angular velocity of the drumstick section 10 exceeds “Threshold 1”, the CPU 11 proceeds to Step S355 (Step S354). In
When the motion state becomes ACTION, the drumstick continues accelerating for the time being, during which the angular acceleration is positive. Therefore, the CPU 11 judges that the judgment result at Step S370 is YES, and ends the sound emission timing detection processing.
When the drumstick section 10 is changed to be in a deceleration state (t3), the angular acceleration of the drumstick section 10 becomes 0 or smaller, and therefore the CPU 11 judges that the judgment result at Step S370 is NO. At Step S371, from a current drumstick tip angular velocity ωst and angular acceleration δωst, the CPU 11 estimates a time when the angular velocity becomes 0. If an estimated time is taken as Trem, the above-described time can be approximately estimated by using the following equations:
Trem=|ωst|/|δωst|.
Subsequently, the CPU 11 judges whether the estimated time is equal to or smaller than “Threshold 5” (Step S372). For example, this “Threshold 5” is assumed to be on the order of 10 milliseconds.
This “Threshold 5” is set as a delay time from the time when a shot is detected to the time when a sound is emitted. This is because, due to the occurrence of a delay in wireless transmission or a delay in sound emission processing which will be described further below, a sound is emitted before timing at which a sound is supposed to be emitted, in order to compensate for the delay. Until the drumstick section 10 sufficiently decelerates, the CPU 11 judges that the judgment result at Step S372 is NO and ends the sound emission timing detection processing. After a while, when the angular velocity of the drumstick section 10 becomes near 0, the estimated time until the end (the angular velocity is 0) becomes equal to or smaller than “Threshold 5”. Then, the CPU 11 judges that the judgment result at Step S372 is YES (at the timing of t4), sets the motion state to SHOT (Step S373), and initializes the SHOT passage time to 0 (Step S374). This SHOT state is to make a notification of sound emission timing, and is used to determine sound emission timing at Step S22 of
When the motion state is SHOT, the CPU 11 updates the motion state to DONE at Step S380, and then ends the sound emission timing detection processing.
When the motion state is DONE, the CPU 11 judges whether the angular velocity is equal to or smaller than “Threshold 3” (Step S390). When judged that the angular velocity is equal to or smaller than “Threshold 3”, the CPU 11 changes the motion state to IDLE (Step S391) and ends the sound emission timing detection processing. When judged at Step S390 that the angular velocity is larger than “Threshold 3”, the CPU 11 determines whether the shot passage time is equal to or smaller than “Threshold 4” (Step S392). When judged that the shot passage time is equal to or smaller than “Threshold 4”, the CPU 11 ends the sound emission timing detection processing. On the other hand, when judged that the shot passage time has exceeded “Threshold 4”, the CPU 11 changes the motion state to IDLE (Step S391), and ends the sound emission timing detection processing.
That is, the DONE state is held until the angular velocity becomes equal to or smaller than “Threshold 3”. This is to prevent an erroneous operation such as emission of a plurality of sounds at the time of stopping. However, if the angular velocity is gradually decelerated and the shot passage time until the angular velocity becomes equal to or smaller than “Threshold 3” exceeds “Threshold 4”, the motion state is changed from DONE to IDLE.
[Sound Emission Amount Detection]
With reference to
First, the CPU 11 determines the motion state. When the motion state is DONE or IDLE, the CPU 11 proceeds to Step S402. When the motion state is ACTION or SHOT, the CPU 11 proceeds to Step S406.
When the motion state is DONE or IDLE, the CPU 11 initializes a peak angular velocity value (a scalar quantity) ωs peak, a shift velocity vst, a peak shift velocity vspeak, and a peak shift acceleration aspeak to 0 (Steps S402 to S405).
The peak angular velocity value ωs peak is a maximum value of the angular velocity detected while the drumstick is being swung for sound emission. The shift velocity vst is a velocity component of translation of the tip of the drumstick. The current peak shift velocity Vspeak is a value retaining a maximum value of a shift velocity LVst. When the swing of the drumstick is detected in sound emission timing detection (Step S305 of
Next, the CPU 11 retains and updates the peak value aspeak of the shift acceleration of the acceleration component LAst in the swing direction found at Step S212 of
Subsequently, the CPU 11 finds an incomplete integral of the acceleration component LAst in the swing direction found at Step S212 of
Next, the CPU 11 compares the velocity LVst in the swing direction and the peak angular velocity value vspeak and, when LVst is larger, the CPU 11 updates vspeak to LVst (Step S409).
Next, the CPU 11 acquires the velocity (sound volume) of the drumstick from three peak values by using, for example, a weighted addition as in the following Equation 5:
Pshot=a1·ωs peak+a2·vspeak+a3·aspeak Equation 5
where a1, a2, and a3 are mixing parameters and are determined by experiments.
Pshot is used as a magnitude of a shot sound.
[Note Event Generation]
With reference to
At the time of a shot, it is determined which sound of sound sources virtually arranged in a space is emitted. Since the shot timing is detected in advance in consideration of the delay in the system, the CPU 11 estimates the position of the drumstick section 10 when a sound is emitted (Step S501). Since the angular velocity and the angular acceleration of the tip of the drumstick section 10 are known, the CPU 11 can estimate the position by acquiring the orientation of the drumstick after Trem. Specifically, the CPU 11 further fragments Trem in time, takes a time interval therebetween as T, and finds angular velocity at each time from the previous angular velocity vector and angular acceleration vector. Furthermore, with this angular velocity vector, the CPU 11 finds a rotation angle vector at each time interval, finds a resultant rotation matrix by using this rotation angle vector, and thereby predicts the next orientation. By repeating this to Trem, the orientation after Trem seconds can be predicted as TL→Wt+Trem. From the orientation parameter, it is possible to obtain a position Py=(PyXPyYPyZ)T in the world coordinate system on the y axis in a direction of the tip of the drumstick section 10.
When six sound sources are mapped (placed) in the world coordinate system, the positions of the respective sound sources (the world coordinate system) are set as follows:
Sound Source 1: forward of (0, 1, 0)
Sound Source 2: in a direction at 60 degrees right forward of (sin 60, cos 60, 0)
Sound Source 3: in a direction at 60 degrees left forward of (−sin 60, cos 60, 0)
Sound Source 4: in a direction at 45 degrees up forward of (0, cos 45, sin 45)
Sound Source 5: in a direction at 60 degrees right forward and at 45 degrees upward of (cos 45 sin 60, cos 45 cos 60, sin 45)
Sound Source 6: in a direction at 60 degrees left forward and at 45 degrees upward of (−cos 45 sin 60, cos 45 cos 60, sin 45).
Positional information of the respective sound sources and timbres corresponding to the respective sound source numbers are stored in advance in the memory of the ROM 14.
The CPU 11 finds a distance between the position Py of the drumstick section 10 at sound emission estimated at Step S501 and the respective sound source positions Ps1=(PsiXPsiYPsiZ)T and takes the nearest one as a sound source of a current shot target (Step S502).
In distance measurement, the CPU 11 calculates an Euclid distance. Alternatively, it is also effective to use a weighted Euclid distance for each component that is insensitive to a distance in a swing direction axis. Since the swing direction has low accuracy because the swing direction is a moving direction, it is desirable to use a distance weighted larger than the rotation axis direction.
Alternatively, the azimuth can be converted to be represented in pitch, yaw, roll angles. The positions of the sound sources and the position of the drumstick may be converted to be represented in angle representation to find each distance. Here, a distance with a weight varied between a pitch direction and a yaw direction may be used. The weight in a roll component is desirably 0.
When the sound source number taken as a shot target at Step S502 or the sound source number determined in sound search processing, which will be described further below with reference to
Next, the CPU 11 checks the yaw direction correction mode determined at Step S79 or Step S80 of
[Sound Search]
With reference to
First, the CPU 11 searches each sound map for the nearest sound source by using a sound search method similar to that at Step S502 of
Next, the CPU 11 stores the found sound source number i in the RAM 15 as a current sound source selection number (Step S602). Subsequently, the CPU 11 reads the previous sound source number, and compares position coordinates of the sound source number with position coordinates of the current sound source. Here, the comparison is made in X and Y coordinates, excluding the Z axis in the vertical direction (Step S603). The vertical direction is not corrected in the present example.
Furthermore, the CPU 11 judges whether the sound sources are in the same azimuth (Step S604). When judged that they are in the same azimuth, the CPU 11 judges whether the horizontal component value of the movement amount found at S202 of
The CPU 11 corrects the azimuth in the direction of the tip of the drumstick in the manner as described above to again find the nearest sound source from each sound map by using a sound search method similar to that at S502 of
Next, to find a movement amount between the next shot and the current shot, the CPU 11 resets the movement amount value to 0 (Step S612). Furthermore, the CPU 11 stores the currently adopted sound source number in the RAM 15 as the previous sound source number (Step 6613).
[Sound Emission Processing]
With reference to
As depicted in
Subsequently, the CPU 31 judges whether the I/F 32 has newly received a note-on event (Step S703). When the judgment result at Step S703 is YES, the CPU 31 performs processing for instructing the sound source section 371 to emit a musical sound with the set sound volume value and timbre based on the received note-on event (Step S704). When the processing at Step S704 ends, the CPU 31 returns to Step S702.
The structure and processing of the musical performance device 1 of the present embodiment have been described above.
In the present embodiment, the CPU 11 obtains the acceleration detected by the acceleration sensor 122 and the angular velocity detected by the angular velocity sensor 123 at every predetermined timing, and stores, in the RAM 15, an orientation parameter in an initial stationary state of the drumstick section 10, which includes the acceleration by gravity detected by the acceleration sensor 122 in the initial stationary state. Then, the CPU 11 updates the orientation parameter according to the angular velocity detected by the angular velocity sensor 123 at every predetermined timing, and calculates acceleration in a gravity direction from the detected acceleration based on the updated orientation parameter. Furthermore, the CPU 11 accumulates the calculated acceleration for each predetermined interval, and corrects the acceleration obtained by accumulation so that the acceleration conforms to the acceleration stored in the RAM 15.
Thus, when the drumstick section 10 is moved at high speed, accuracy in estimating the orientation of the drumstick section 10 can be improved by correcting the gravity direction.
Also in the present embodiment, in the initial stationary state of the drumstick section 10, the CPU 11 causes the magnetic sensor 121 to detect a geomagnetic component in each of directions of three axes orthogonal to each other including an axis in a longitudinal direction of the drumstick section 10, converts the detected geomagnetic components to geomagnetic components in directions of other three axes based on the orientation parameter described above, and stores the components obtained by conversion in the RAM 15. Then, the CPU 11 obtains the geomagnetic components of the respective axes detected by the magnetic sensor 121 at every predetermined timing and, based on the orientation parameter, converts the geomagnetic components of the respective axes obtained at every predetermined timing to geomagnetic components in the directions of different three axes described above. Furthermore, the CPU 11 accumulates the geomagnetic components obtained by conversion for each predetermined interval, and corrects each geomagnetic component obtained by accumulation so that the geomagnetic component conforms to the geomagnetic component stored in the RAM 15.
Thus, when the drumstick section 10 is moved at high speed, accuracy in estimating the orientation of the drumstick section 10 can be improved by correcting the geomagnetic direction.
Furthermore, in the present embodiment, after the angular velocity value obtained by the angular velocity sensor 123 exceeds “Threshold 1” and then becomes below “Threshold 2”, the CPU 11 transmits a note-on event to the sound emitting section 30. “Threshold 2” is a value according to the maximum value after the angular velocity value obtained by the angular velocity sensor 123 exceeds “Threshold 1” (specifically, a value obtained by multiplying the maximum value by a predetermined ratio value).
Thus, accuracy in sound emission can be improved by generating sound emission timing at a predetermined time ahead of the original shot timing, in consideration of a sound emission delay time.
Still further, in the present embodiment, the CPU 11 estimates a time until the angular velocity becomes 0 after the value of the angular velocity obtained by the angular velocity sensor 123 exceeds “Threshold 1” and, when the estimated time becomes below “Threshold 5”, transmits a note-on even to the sound emitting section 30.
Thus, accuracy in sound emission can be improved by generating sound emission timing at a predetermined time ahead of the original shot timing, in consideration of a sound emission delay time.
Yet still further, in the present embodiment, the CPU 11 calculates the angular velocity and the angular acceleration of the tip of the drumstick section 10 based on the angular velocity obtained by the angular velocity sensor 123, and estimates a time until the value of the angular velocity becomes 0 after the value of the angular velocity obtained by the angular velocity sensor 123 exceeds “Threshold 1”, based on the calculated angular velocity and angular acceleration of the tip of the drumstick section 10.
Thus, accuracy in estimating the time until the angular velocity value becomes 0 can be improved.
Yet still further, in the present embodiment, the CPU 11 estimates the rotation axis direction of the drumstick section 10 during musical performance based on the angular velocity obtained by the angular velocity sensor 123, calculates the angular velocity of the tip of the drumstick section 10 based on the angular velocity obtained by excluding an axis component in the longitudinal direction of the drumstick section 10 from the angular velocity obtained by the angular velocity sensor 123, and calculates the position of the drumstick section 10 in the world coordinate system after a predetermined time based on the estimated latest rotation axis direction and the calculated latest angular velocity of the tip of the drumstick section 10. Of the plurality of areas of the sound source map, the CPU 11 transmits a note-on event of a musical sound corresponding to the area nearest to the calculated position to the sound emitting section 30.
Thus, even if the drumstick section 10 is diagonally swung, the timbre at the position of the drumstick section 10 can be emitted at the original shot timing.
Still further, in the present embodiment, the CPU 11 estimates the rotation axis direction of the drumstick section 10 during musical performance based on the angular velocity obtained by the angular velocity sensor 123, and calculates the angular velocity of the tip of the drumstick section 10 based on angular velocity obtained by excluding an axial component in a longitudinal direction of the drumstick section 10 from the angular velocity obtained by the angular velocity sensor 123. Based on the estimated latest rotation axis direction and the calculated latest angular velocity of the tip of the drumstick section 10, the CPU 11 calculates the position of the drumstick section 10 in the world coordinate system after a predetermined time, calculates a movement distance based on the acceleration obtained by the acceleration sensor 122, and corrects the position of the drumstick section 10 in the world coordinate system after a predetermined time based on the calculated position and the calculated movement distance. Then, of the plurality of areas of the sound source map, the CPU 11 transmits a note-on event of a musical sound corresponding to the area nearest to the corrected position to the sound emitting section 30.
Thus, even if the drumstick section 10 is diagonally swung and is subjected to translation, a sound can be emitted with a timbre at the position of the drumstick section 10 at the original shot timing.
Yet still further, in the present embodiment, the CPU 11 calculates a maximum value of the angular velocity of the drumstick section 10 during musical performance based on the angular velocity obtained by the angular velocity sensor 123, calculates a maximum of acceleration of the drumstick section 10 during musical performance based on the acceleration obtained by the acceleration sensor 122, and control the sound volume of the musical sound to be emitted based on the calculated maximum value of the angular velocity and the maximum value of the acceleration.
Thus, even if a virtual sound source is placed vertically to the world coordinate system, appropriate sound volume control can be performed by reflecting the strength of the swing motion.
While the present invention has been described with reference to the preferred embodiments, it is intended that the invention be not limited by any of the details of the description therein but includes all the embodiments which fall within the scope of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2012-084368 | Apr 2012 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
6388183 | Leh | May 2002 | B1 |
7474197 | Choi | Jan 2009 | B2 |
20010015123 | Nishitani | Aug 2001 | A1 |
20050213476 | Choi et al. | Sep 2005 | A1 |
20060170562 | Choi et al. | Aug 2006 | A1 |
20070000374 | Clark et al. | Jan 2007 | A1 |
20070255434 | Inagaki | Nov 2007 | A1 |
20090209344 | Okamura | Aug 2009 | A1 |
20090216483 | Young | Aug 2009 | A1 |
20090325703 | Suzuki et al. | Dec 2009 | A1 |
20100009746 | Raymond et al. | Jan 2010 | A1 |
20100156785 | Nakaoka | Jun 2010 | A1 |
20100263518 | Nishitani et al. | Oct 2010 | A1 |
20110290097 | Takahashi et al. | Dec 2011 | A1 |
20120024128 | Takahashi | Feb 2012 | A1 |
20120059494 | David | Mar 2012 | A1 |
20120070137 | Watanabe | Mar 2012 | A1 |
20120231883 | Hayashi et al. | Sep 2012 | A1 |
20120266739 | Tsuji | Oct 2012 | A1 |
20130255476 | Sakurai et al. | Oct 2013 | A1 |
20130262024 | Sakurai et al. | Oct 2013 | A1 |
Number | Date | Country |
---|---|---|
1 583 073 | Oct 2005 | EP |
1 686 778 | Aug 2006 | EP |
11085387 | Mar 1999 | JP |
2007-256736 | Oct 2007 | JP |
2010263930 | Nov 2010 | JP |
2008026357 | Mar 2008 | WO |
Entry |
---|
U.S. Appl. No. 13/853,781; First Named Inventor: Keiichi Sakurai; Title: “Orientation Detection Device, Orientation Detection Method and Program Storage Medium”; filed Mar. 29, 2013. |
U.S. Appl. No. 13/854,686; First Named Inventor: Keiichi Sakurai; Title: “Playing Apparatus, Method, and Program Recording Medium”; filed Apr. 1, 2013. |
Extended European Search Report (EESR) dated Aug. 2, 2013 (in English)issued in counterpart European Application No. 13162007.2. |
“Wii MotionPlus”, Wikipedia.org, URL: https://en.wikipedia.org/w/index.php?title=Wii_MotionPlus&oldid=482109037, Sections: “Technology and Features” and “Development”, Five pages (in English). |
Sawada H. et al., “Gesture Recognition Using an Acceleration Sensor and its Application to Musical Performance Control”, Electronics & Communications in Japan, Part 3, vol. 80, No. 5, May 1997, Fundamental Electronic Science, pp. 9-17 (in English). |
Japanese Office Action (and English translation thereof) dated Mar. 15, 2016, issued in counterpart Japanese Application No. 2012-084368. |
Japanese Office Action dated Mar. 13, 2018 issued in counterpart Japanese Application No. 2016-252883. |
Japanese Office Action dated Nov. 6, 2018 (and English translation thereof) issued in counterpart Japanese Application No. 2016-252883. |
Number | Date | Country | |
---|---|---|---|
20130262021 A1 | Oct 2013 | US |