CN107945778B - Electronic musical instrument - Google Patents
Electronic musical instrument Download PDFInfo
- Publication number
- CN107945778B CN107945778B CN201711480700.5A CN201711480700A CN107945778B CN 107945778 B CN107945778 B CN 107945778B CN 201711480700 A CN201711480700 A CN 201711480700A CN 107945778 B CN107945778 B CN 107945778B
- Authority
- CN
- China
- Prior art keywords
- sensor group
- signal
- sensor
- processor
- ultrasonic
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H3/00—Instruments in which the tones are generated by electromechanical means
- G10H3/12—Instruments in which the tones are generated by electromechanical means using mechanical resonant generators, e.g. strings or percussive instruments, the tones of which are picked up by electromechanical transducers, the electrical signals being further manipulated or amplified and subsequently converted to sound by a loudspeaker or equivalent instrument
- G10H3/14—Instruments in which the tones are generated by electromechanical means using mechanical resonant generators, e.g. strings or percussive instruments, the tones of which are picked up by electromechanical transducers, the electrical signals being further manipulated or amplified and subsequently converted to sound by a loudspeaker or equivalent instrument using mechanically actuated vibrators with pick-up means
- G10H3/146—Instruments in which the tones are generated by electromechanical means using mechanical resonant generators, e.g. strings or percussive instruments, the tones of which are picked up by electromechanical transducers, the electrical signals being further manipulated or amplified and subsequently converted to sound by a loudspeaker or equivalent instrument using mechanically actuated vibrators with pick-up means using a membrane, e.g. a drum; Pick-up means for vibrating surfaces, e.g. housing of an instrument
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/32—Constructional details
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/46—Volume control
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Electrophonic Musical Instruments (AREA)
Abstract
The application relates to an electronic musical instrument, wherein the current sensor group in each sensor group is triggered to work and transmit a first signal, when a corresponding first return signal is received, a first hitting distance is obtained according to the receiving time of the first return signal and the transmitting time of the first signal, a second hitting distance is obtained according to the receiving time of the second return signal and the transmitting time of the second signal, a hitting speed is obtained through the first hitting distance, the second hitting distance and a preset threshold duration, and then the electronic musical instrument can make a sound with a volume corresponding to the hitting speed and a tone corresponding to the identity of a non-contact sensor receiving the first return signal. When the timing time reaches the preset time, the next sensor group in each sensor group is used as the current sensor group, and the next sensor group in each sensor group returns to execute triggering of the current sensor group, namely, each sensor group is triggered in turn, so that the problem that all sensors are easy to generate interference when working simultaneously can be avoided, and the sensing accuracy is improved.
Description
Technical Field
The present invention relates to electronic devices, and particularly to an electronic musical instrument.
Background
In recent years, the technology of electronization of musical instruments has become a focus in the field of electronic research, and various electronic musical instruments have been produced, and an electronic drum is one of the common electronic musical instruments. The electronic drum is a musical instrument which is used for triggering an electronic signal by a musician through beating a drum surface, processing the electronic new signal by utilizing an electronic synthesis technology or a sampling technology and generating sound through an electroacoustic device. The common electronic musical instrument with rubber electronic board type and the electronic musical instrument with mesh simulation (also called mesh drum head) are made of rubber material as the panel and connected with the sensor externally, for example, the sensor can be installed on the edge of the drum, the mesh drum head is the new-type high-tech battlefield at present, the mesh drum head combines the dual texture of the drum head and the sensor, the sound volume when striking the mesh drum head is lower than that of the traditional rubber drum head, the drummer can adjust the tension thereof according to the preference of the drummer, and the inside of the mesh drum head is provided with a plurality of sensors inside the panel, so the mesh drum head can also be used as the drum frame effect.
At present, general electronic musical instruments have light in weight, small and easy dismouting, convenient to carry and be convenient for characteristics such as quick assembly debugging. However, the striking surface is easily damaged during striking of the electronic musical instrument. In order to solve the problem that the drum surface is easy to damage an electronic musical instrument, the subsequent electronic musical instrument is beaten in a non-contact manner, and non-contact sensing is carried out through sensors arranged on the electronic musical instrument, however, interference is easy to generate among the sensors, namely, a detection beam emitted by one sensor is received by another sensor as a detection beam of the other sensor, so that the sensing accuracy of the sensors is poor, and further the sound production of the electronic musical instrument is inaccurate.
Disclosure of Invention
Accordingly, there is a need for an electronic musical instrument that is capable of generating sound inaccurately due to the interference of the existing electronic musical instrument.
An electronic musical instrument comprises a main body, a processor and at least two sensor groups, wherein each sensor group is arranged on the main body respectively, any one sensor group comprises at least two non-contact sensors, and each non-contact sensor in each sensor group is connected with the processor respectively; each non-contact sensor corresponds to an identity mark;
the processor starts timing when receiving a working instruction, takes any one of the sensor groups as a current sensor group, triggers the current sensor group to work, transmits a first signal, when the non-contact sensor in the current sensor group receives a first return signal corresponding to the transmitted first signal within a preset time range after the start of timing, the processor acquires a first hitting distance according to the receiving time of the first return signal and the transmitting time of the first signal, triggers the non-contact sensor to transmit a second signal after receiving a preset threshold time of the first return signal, acquires a second hitting distance according to the receiving time of the second return signal and the transmitting time of the second signal when receiving a second return signal corresponding to the transmitted second signal within the preset time range, acquires a hitting speed according to the first hitting distance, the second hitting distance and the preset threshold time, transmits a hitting speed corresponding to the identity identifier, a hitting tone color corresponding to the identity identifier, and a preset tone color corresponding to the sensor group, and resets the current sensor group when the transmitting time of the non-contact sensor group reaches the preset time range, and resets the current sensor group when the transmitting time reaches the current sensor group, the processor executes the sound volume except the current sensor group, and resets the current sensor group.
In one embodiment, the distance between the non-contact sensors in any one of the sensor groups is greater than a preset interference prevention distance.
In one embodiment, after the preset trigger interval time for stopping the current sensor group, the timer is cleared.
In one embodiment, the processor sets a counter in advance, the count value of the counter is initially zero, the processor generates an interrupt instruction every preset interval time when receiving the working instruction, increases the count value by 1 every time the interrupt instruction is received, and clears the counter when the count value reaches a preset number of times and the timing duration reaches the preset duration.
In one embodiment, the non-contact sensor is an ultrasonic sensor.
In one embodiment, the non-contact sensor comprises an ultrasonic transmitter and an ultrasonic receiver, and the processor is respectively connected with the ultrasonic generator and the ultrasonic receiver;
in the step of triggering the current sensor group to work and transmitting a first signal, respectively triggering the ultrasonic transmitters of all non-contact sensors in the current sensor group to transmit ultrasonic signals;
and receiving a first return signal corresponding to the first signal through the ultrasonic receiver, wherein the first return signal is a return signal corresponding to the first ultrasonic signal.
In one embodiment, the electronic musical instrument further includes a filter circuit, and the ultrasonic receiver is connected to the processor through the filter circuit.
In one embodiment, the processor stops the operation of each sensor group when receiving a stop instruction.
In one embodiment, the number of the sensor groups is three, and the sensor groups include a first sensor group, a second sensor group, and a third sensor group, where the number of the non-contact sensors in the first sensor group is three, and the number of the non-contact sensors in the second sensor group and the third sensor group is two, respectively.
In one embodiment, the electronic musical instrument further includes a first sound generating device and a second sound generating device respectively connected to the processor, the first sound generating device and the second sound generating device are disposed opposite to the main body, and the processor generates corresponding sounds through the first sound generating device and the second sound generating device respectively.
In the process of sounding through inductive striking, any one of the sensor groups is used as the current sensor group and is triggered to work, namely, a first signal is emitted, when a first return signal corresponding to the emitted first signal is received, a first striking distance can be obtained according to the receiving time of the first return signal and the emitting time of the first signal, a second striking distance is obtained according to the receiving time of the second return signal and the emitting time of the second signal, the striking speed is obtained through the first striking distance, the second striking distance and the preset threshold duration, and then the sound with the volume corresponding to the striking speed and the tone corresponding to the identity of the non-contact sensor receiving the first return signal can be emitted. When the timing duration reaches the preset duration, stopping transmitting signals of the current sensor group, resetting the timing, restarting the timing, taking any one of the sensor groups except the current sensor group as the current sensor group, returning to execute triggering the current sensor group to transmit signals, namely triggering the sensor groups in turn, so that the problem that the sensing influence is caused by sensing errors due to the fact that all sensors work simultaneously can be avoided, the sensing accuracy is improved, and the sounding is more accurate.
Drawings
FIG. 1 is a block diagram of an electronic musical instrument of an embodiment;
FIG. 2 is a block diagram of a filter circuit in an electronic musical instrument according to an embodiment;
FIG. 3 is a timing chart of the process of triggering the ultrasonic sensor to sense in the present embodiment;
fig. 4 is a diagram illustrating a relationship between a sampling value and a distance value in the present embodiment.
Detailed Description
Referring to fig. 1, an embodiment of the present invention provides an electronic musical instrument, including a main body 100, a processor (not shown), and at least two sensor groups, each sensor group being disposed on the main body 100, each sensor group including at least two non-contact sensors, each non-contact sensor in each sensor group being connected to the processor; wherein, each non-contact sensor corresponds to the identification respectively.
The processor starts timing when receiving a working instruction, takes any sensor group in the sensor groups as a current sensor group, triggers the current sensor group to transmit a first signal, when a non-contact sensor in the current sensor group receives a first return signal corresponding to the transmitted first signal within a preset time range after the timing is started, the processor acquires a first hitting distance according to the receiving time of the first return signal and the transmitting time of the first signal, triggers the non-contact sensor to transmit a second signal after receiving a preset threshold time of the first return signal, when a second return signal corresponding to the transmitted second signal is received within the preset time range, the processor acquires a second hitting distance according to the receiving time of the second return signal and the transmitting time of the second signal, acquires a hitting speed according to the first hitting distance, the second hitting distance and the preset threshold time, the processor sends a sound with a tone color corresponding to the identity and a volume corresponding to the hitting speed according to the identity and the hitting speed of the non-contact sensor, when the timing reaches the preset time, stops transmitting of the current sensor group, resets the signal as the current sensor group, and resets the signal to the current sensor group except the current sensor group.
Each non-contact sensor has a unique corresponding identification, such as a serial number, each identification corresponds to different timbres, that is, the identification of each non-contact sensor corresponds to the timbre, for example, the total number of the non-contact sensors in each sensor group is 7, the identifications are 1, 2, 3, 4, 5, 6 and 7, if the timbre corresponding to the identification 1 corresponds to the timbre of a drum, when the current sensor group is triggered to work to transmit signals, if the non-contact sensor receives a return signal, it indicates that a hit on an electronic device is sensed in the sensing range of the non-contact sensor, if the non-contact sensor with the identification 1 works, and when a first return signal corresponding to the transmitted first signal is received, the processor sends the timbre corresponding to the identification 1, that is, a drum sound can be sent. For another example, the tone corresponding to the identity 2 is the tone of a piano, and if the non-contact sensor with the identity 2 receives the first return signal corresponding to the transmitted first signal, the processor sends the tone corresponding to the identity 2, so that the piano sound can be sent.
The volume of the sound to be emitted is related to the striking strength, and in this embodiment, the striking strength is represented by the striking speed, that is, the higher the striking speed, the larger the volume of the sound to be emitted, for example, when the striking speed is 1 or less, the processor controls the sound to be emitted at a smaller volume corresponding to the striking speed, when the striking speed is greater than 1 and less than 2, the processor controls the sound to be emitted at a volume greater than that when the striking speed is 1 or less, when the striking speed is greater than 2 and less than 5, the processor controls the sound to be emitted at a volume greater than that when the striking speed is greater than 1 and less than 2, when the striking speed is greater than 5 and less than 10, the processor controls the sound to be emitted at a volume greater than that when the striking speed is greater than 2 and less than 5 or equal to 10, when the striking speed is greater than 5 and less than or equal to 15, the processor controls the sound to be emitted at a volume greater than that when the striking speed is greater than 5 and less than 10 or equal to 10. In the process of obtaining the hitting speed, the hitting object can move in the hitting process, the hitting distance of the hitting object at different time points is sensed through sending signals, the moving distance of the hitting object in the period of time can be known, and the hitting speed can be further known. Specifically, a hitting distance difference is obtained first, and the hitting speed is obtained through the distance difference and a preset threshold duration, where the distance difference is a distance difference between a first hitting distance and a second hitting distance. And the preset threshold duration is less than the preset duration. In one example, the preset threshold duration is 10 microseconds and the preset duration is 200 milliseconds.
In the process of sounding through inductive striking, any one of the sensor groups is taken as the current sensor group and is triggered to work, namely, a first signal is emitted, when a first return signal corresponding to the emitted first signal is received, a first striking distance can be obtained according to the receiving time of the first return signal and the emitting time of the emitted first signal, a second striking distance is obtained according to the receiving time of the second return signal and the emitting time of the second signal, the striking speed is obtained through the first striking distance, the second striking distance and the preset threshold duration, and then the sound with the volume corresponding to the striking speed and the tone corresponding to the identity of the non-contact sensor receiving the first return signal can be emitted. When the timing duration reaches the preset duration, stopping transmitting signals of the current sensor group, resetting the timing, restarting timing, taking any one of the sensor groups except the current sensor group as the current sensor group, returning to execute triggering of the current sensor group to transmit signals, namely triggering the sensor groups in turn, so that the problem that induction errors caused by simultaneous working of all the sensors cause induction influence can be avoided, the induction accuracy is improved, and then the sounding is more accurate.
In addition, each non-contact sensor corresponds to the tone, and when the processor sounds after the non-contact sensors sense the return signals, the processor sends out the sound corresponding to the identity marks of the contact sensors. In this embodiment, the formula for obtaining the first distance is: first distance = (time difference between reception time of the first return signal and transmission time of the first signal) × sound speed/2, sound speed is 340M/S. The formula for obtaining the second distance is: second distance = (time difference between the time of receipt of the second return signal and the time of transmission of the second signal) × speed of sound/2.
In one embodiment, the distance between the non-contact sensors in any one sensor group is greater than the preset interference prevention distance.
If the distance between the non-contact sensors in the same sensor group is too close, cross interference may be generated, that is, a detection beam emitted by one non-contact sensor may be received as a detection beam of its own than another non-contact sensor, and when the non-contact sensors are disposed in the main body 100, the distance between the non-contact sensors in any one sensor group is greater than a preset interference prevention distance, that is, the distance between the non-contact sensors is greater than the preset interference prevention distance, so that the occurrence of interference between the non-contact sensors can be reduced.
In one embodiment, the timer is cleared after a preset trigger interval to stop the current sensor group.
When the sensor groups are triggered to work in turn, the sensor groups are triggered at preset trigger interval time, namely the trigger interval is the preset trigger interval time, and after the current sensor group finishes triggering and sensing, the sensor groups need to wait for the preset trigger interval time and then trigger the next sensor group to work to sense. Thus, residual wave interference among the sensor groups can be avoided. In one example, the preset trigger interval time may be 20 milliseconds.
In one embodiment, the processor sets a counter in advance, the count value of the counter is initially zero, the processor generates an interrupt instruction every other preset interval time when receiving a working instruction, the count value is increased by 1 every time the interrupt instruction is received, and the timing duration reaches the preset duration when the count value reaches the preset times, and the counter is cleared.
It can be understood that the product of the preset interval duration and the preset times is the preset duration, and when the count value reaches the preset times, the count value indicates that the timing duration reaches the preset duration, and at this time, the counter is cleared to zero so as to time the next sensor group for subsequent work. In one example, the preset interval time is 10 milliseconds and the preset number of times is 20.
In one embodiment, the non-contact sensor is an ultrasonic sensor.
The ultrasonic sensor is a sensor developed by utilizing the characteristics of ultrasonic waves. The ultrasonic wave is a mechanical wave with vibration frequency higher than that of sound wave, is generated by the vibration of a transduction wafer under the excitation of voltage, and has the characteristics of high frequency, short wavelength, small diffraction phenomenon, good directivity, directional propagation as rays and the like. The ultrasonic wave has great penetrating power to liquid and solid, especially to opaque solid, and may penetrate several tens of meters deep. The ultrasonic waves encounter impurities or interfaces and cause significant reflections that are reflected as echoes. In this embodiment, when the ultrasonic sensor is triggered to operate, the ultrasonic sensor emits ultrasonic waves, and when the electronic device is subjected to non-contact striking, the ultrasonic waves are reflected by a striking object, so that the ultrasonic sensor can receive a return signal to realize sensing of the striking object.
In one embodiment, the non-contact sensor comprises an ultrasonic transmitter and an ultrasonic receiver, and the processor is respectively connected with the ultrasonic generator and the ultrasonic receiver; in the process of triggering the current sensor group to work and transmitting a first signal, respectively triggering ultrasonic transmitters of all non-contact sensors in the current sensor group to transmit a first ultrasonic signal; and receiving a first return signal corresponding to the first signal through the ultrasonic receiver, wherein the first return signal is a return signal corresponding to the first ultrasonic signal.
It can be understood that, in this embodiment, the first signal is a first ultrasonic signal, the first return signal is a first ultrasonic return signal, and the return signal corresponding to the first ultrasonic signal is the first ultrasonic return signal.
In one embodiment, the ultrasonic diagnosis device further comprises a filter circuit, and the ultrasonic receiver is connected with the processor through the filter circuit.
In order to eliminate the interference in the first return signal and ensure the accuracy of the signal, a filter circuit can be connected between the ultrasonic sensor receiver and the processor, the first return signal is filtered through the filter circuit, the interference is eliminated, and the accuracy of the first return signal is improved.
In one example, the filter circuit includes a first diode D1, a second diode D2, a capacitor C, and a resistor R, i.e., an RC filter circuit, the ultrasonic receiver is respectively connected to one end of the capacitor C, an anode of the first diode D1, a cathode of the second diode D2, and one end of the resistor R in the filter circuit, the other end of the capacitor C and an anode of the second diode D2 are respectively grounded, the cathode of the first diode D1 is connected to a power supply (in one example, a power supply of 3.3V), and the other end of the resistor R is connected to the processor. Specifically, the capacitance of the capacitor C may be 0.01 microfarads.
In one embodiment, the processor stops the operation of each sensor group when receiving the stop instruction.
When the electronic musical instrument is not required to be used for sensing and sounding, the electronic musical instrument can be controlled to stop working, specifically, the stop key on the main body 100 of the electronic musical instrument can be operated, for example, the stop key can be pressed, so that a stop instruction can be generated, and the processor controls each sensor group to stop working when receiving the stop instruction, so that the conditions that each sensor group is easy to damage and the service life is shortened due to continuous working can be avoided.
In one embodiment, the number of the sensor groups is three, and the sensor groups include a first sensor group, a second sensor group and a third sensor group, the number of the non-contact sensors in the first sensor group is three, and the number of the non-contact sensors in the second sensor group and the third sensor group is two respectively.
Namely, 7 non-contact sensors are arranged on the main body 100 of the electronic device, and each non-contact sensor performs obstacle sensing in a corresponding working time period, that is, when a user performs non-contact striking, the striking object reflects a signal sent by the sensor, so as to realize distance detection of the striking object, namely, an obstacle. In this embodiment, the tone colors corresponding to the 7 non-contact sensors may be partially the same, may be different, or may be all the same.
Specifically, with continued reference to fig. 1, the first sensor group includes a first non-contact sensor 201, a second non-contact sensor 202, and a third non-contact sensor 203, the second sensor group includes a fourth non-contact sensor 204 and a fifth non-contact sensor 205, and the third sensor group includes a sixth non-contact sensor 206 and a seventh non-contact sensor 207. The sensors in each group are triggered at preset trigger intervals, for example, the triggering intervals can be 20 milliseconds, and the residual wave interference between each group can be ignored.
In one embodiment, a connecting line between three non-contact sensors in the first sensor group is in an isosceles triangle shape, a connecting line between two non-contact sensors in the second sensor group and two non-contact sensors in the third sensor group respectively surrounds one non-contact sensor in the first sensor group, and the connecting line is in an isosceles trapezoid shape.
Two non-contact sensors in the three non-contact sensors in the first sensor group are respectively the same as the other remaining non-contact sensors in distance, and it can be understood that connecting lines among the three non-contact sensors in the first sensor group are in an isosceles triangle shape. In addition, a connecting line between the two non-contact sensors in the second sensor group and the two non-contact sensors in the third sensor group surrounds one non-contact sensor in the first sensor group, and the connecting line is in an isosceles trapezoid shape. Thus, the position relationship between the non-contact sensors on the main body 100 can be ensured to be more regular, the appearance is more beautiful, and the risk of interference between the non-contact sensors can be reduced.
In one embodiment, the electronic musical instrument further includes a first sound generating device 208 and a second sound generating device 209 respectively connected to the processor, the first sound generating device 208 and the second sound generating device 209 are disposed opposite to the main body 100, and the processor generates corresponding sounds through the first sound generating device 208 and the second sound generating device 209, respectively, when the processor generates the corresponding sounds. In the present embodiment, the first sound generating device 208 and the second sound generating device 209 may be speakers, respectively.
The operation of the electronic musical instrument is described below with an embodiment, specifically, sensing by an ultrasonic sensor of HC-SR04 model is taken as an example.
The HC-SR04 model ultrasonic sensor can provide a non-contact distance sensing function of 2cm to 400 cm, and the distance measurement precision can reach 3 mm. When the ultrasonic sensor is triggered by the processor to work, the ultrasonic sensor firstly transmits ultrasonic waves, meanwhile, the timer is started, when echoes are received, the timer is closed, the transit time of the ultrasonic waves (namely, the time difference between the time of receiving the echoes and the time of transmitting the ultrasonic waves) is calculated, and according to the length of the transit time, a level of which the voltage is linearly related to the transit time is output. The ultrasonic sensor has the characteristics of high distance measurement precision, low price and the like, so that the induction accuracy can be improved.
The principle of inductive ranging of the HC-SR04 type ultrasonic sensor is as follows:
wherein, the technical parameters mainly involved are as follows:
1. the voltage used: DC5V;
2. static current: less than 2mA;
3. and (3) level output: 5V high;
4. and (3) level output: bottom 0V;
5. induction angle: not more than 15 degrees;
6. detecting the distance: 2cm-450cm 7, the high precision can reach 0.2cm;
7. the connection mode is VCC, trig (control end), echo (receiving end) and GND.
The working principle is as follows:
1. using IO to trigger ranging to give at least 10us of high level signals;
2. after triggering, 8 square waves of 40khz are sent, and whether a signal returns or not is automatically detected;
3. when there is a signal return, a high level is output through IO, and the high level time is the time from the transmission of the ultrasonic wave to the return. Test distance = (high level time acoustic velocity (340M/S))/2.
The ultrasonic sensor mainly utilizes a Doppler principle, high-frequency ultrasonic waves beyond the perception of human physical ability are emitted outwards through the crystal oscillator, 25-40 kHz waves are typically selected, then the frequency of the reflected waves is detected, if objects move in an area, the frequency of the reflected waves slightly fluctuates, namely, the Doppler effect, so that the movement of the objects in an illumination area is judged, and the purpose of controlling a switch is achieved.
The longitudinal oscillation characteristic of the ultrasonic wave can be transmitted in gas, liquid and solid, and the transmission speeds of the ultrasonic wave are different; it also has refraction and reflection phenomena, and its frequency is lower and attenuation is faster when it is transmitted in air, and it is lower and transmission is farther when it is transmitted in solid and liquid. It is these characteristics of ultrasound that are utilized by ultrasonic sensors. The ultrasonic sensor has the characteristics of large sensitivity range, no visual blind area, no interference from obstacles and the like, and is the most effective method for detecting the motion of small objects.
The ULTD5N-350 type ultrasonic sensor can provide a non-contact distance sensing function of 3 cm-3.5 m, and comprises an ultrasonic transmitter, a receiver and a control circuit. The basic working principle is that the ultrasonic sensor is given a trigger signal and then emits ultrasonic waves, and when the ultrasonic waves are projected to an object and reflected back, the module outputs a echo signal to judge the distance of the object according to the time difference between the trigger signal and the echo signal.
The principle of sensing by the ultrasonic sensor is explained by a timing chart, and as can be seen from the timing chart of fig. 3, the ultrasonic sensor can perform distance measurement only by providing a short-term 10uS pulse trigger signal. After the ultrasonic sensor is triggered, the transmitting head of the ultrasonic sensor sends out 8 periodic levels of 40kHz, and simultaneously detects echoes. And outputting a reverberation signal once the echo signal is detected. The reverberation signal is a distance object in which the width of a pulse is proportional. The distance can be calculated by the time interval from the transmission of the signal to the reception of the echo signal. In the present embodiment, the measurement period is 60ms or more than 60ms to prevent the influence of the transmitted signal on the echo signal.
In addition, development module adopts Arduino ProMini, for the semi-custom version of Arduino Mini (for the simplest miniature version of Arduino, an open source electronic prototype platform that Arduino a section is convenient and flexible, convenient to use), all outside pin through-holes do not have the welding, and are compatible with Mini version pin. The processor core of the Arduino ProMini is ATmega168, and is provided with 14 digital input/output ports (6 of which can be used as PWM output), 5V working voltage, 5-12V input voltage, 40mA IO pin (input/output pin) direct current, 16KB storage size of a flash Memory (2 KB is used for bootloader, namely starting loading), 1KB storage of an SRAM (static random access Memory) (ATmega 328), 0.5KB storage of an EEPROM (electrically erasable programmable read only Memory) (ATmega 328) and 16MHz working clock. In order to ensure the accuracy of the signal, an RC filter circuit is designed between the ultrasonic receiver and the processor for filtering and removing interference signals and effectively inhibiting spike noise. The RC filter circuit is shown in detail in fig. 2. The two diodes in the figure act as clipping to limit the pin voltage between 0V and 5V to protect the ATmega168 processor.
The process of the electronic musical instrument in the present embodiment of sensing a hit object is specifically as follows:
first, the whole electronic musical instrument is powered on, that is, the processor (in this embodiment, the ATMEGA168 processor) and the non-contact sensors are powered on respectively, the reset pin of the ATMEGA168 processor is pulled down, and the ATMEGA168 processor performs the system power-on reset operation, wherein the reset time is 20ms. After the reset is completed, the initialization boot of the system is carried out, and the initialization of the kernel of the control system, the global parameters and the peripheral equipment is completed. The system initialization boot module performs the following functions: initializing self-test functions of hardware resources such as ATMEGA168 processor internal registers, processors, memories, etc., initializing IO pins and various peripheral (AD, SCI, EVM) hardware resources, and initializing system variables and interrupt initialization. After the system initialization is finished, the system enters a standby working mode, and once an instruction sent by the upper computer is received, namely the processor receives a working instruction, the sensor can be triggered to rapidly enter the working mode. In the working mode, the ATmega168 processor controls the ultrasonic sensor into three parts: multi-sensor packet triggering, a/D sampling and data processing. The specific process is as follows:
when the processor receives a working instruction, the timer is started to interrupt, the timer generates an interrupt instruction every 10ms, a counting value PT2 is designed in the interrupt instruction, the initial value is 0, and the self-increment operation is carried out on the processor every time the processor enters one interrupt. Simultaneously triggering one group of ultrasonic sensors, resetting to 0 every time the PT2 value is increased to 20, and triggering the ultrasonic sensors of the next group. In this way, a group of ultrasonic sensors is triggered in turn every 200 ms. In the present embodiment, the ultrasonic sensors are divided into three groups in total, and thus the time to achieve one cycle of all the sensors triggering is 600ms. After the triggering of the sensor is realized, the data returned by the sensor is subjected to A/D sampling. The ATMEGA168 processor is provided with a 14-path 10-bit analog-to-digital converter in a chip, and the minimum conversion time is 500ns.
Specifically, the implementation adopts 7-way a/D sampling, so the a/D module is configured in the cascade mode, and meanwhile, the register MAXCONV =9 (the maximum register conversion channel is 9), and the trigger mode of the a/D module is interrupt trigger. Since a certain time is required between the transmission and return of the ultrasonic wave, the time is calculated as follows: the maximum distance is measured to be 4m, the speed of the ultrasonic wave is assumed to be 340m/s, the time needs to be multiplied by 2 in consideration of round trip, the final result is 19ms, a certain margin is reserved, and the interval between trigger and A/D sampling is determined to be 20ms. So when the value of PT2 is 4, i.e. the middle interval is 50ms, the a/D sampling module is turned on to implement the sampling function. The ultrasonic sensor returns an analog voltage quantity, the value obtained after A/D conversion is a numerical value which is in positive linear relation with the distance, and is not the distance value between the sensor and the surrounding objects, and then the numerical value after A/D conversion is converted into a real distance value. The algorithm process is as follows: because the A/D sampling value and the distance form a positive linear relation, and the maximum value and the minimum value of the sampling value correspond to the maximum value and the minimum value of the distance one by one, a linear equation can be solved through coordinates of the maximum value and the minimum value, and the A/D conversion value at this time is substituted into the equation, so that the distance value corresponding to the value can be obtained. The sampling values as a function of the distance values are shown in fig. 4.
In addition, the distance measurement of the ultrasonic sensor must have errors, which causes inaccuracy of precision and may have some abnormal values with large deviation from the true distance. Since the environment around the robot is uncertain and dynamic, the sensor measurement value may be abruptly changed due to abrupt change of the environment. In order to distinguish whether the value is an abnormal value or a normal mutation value, in the embodiment, an arithmetic mean filtering method is adopted, the previous N times value is recorded, an average value is obtained, when the current value and the average value are within a certain difference, the current value and the average value are considered to be effective, and if the current value and the average value are outside the difference, the current value and the average value are considered to be invalid values, and the current value and the average value are rejected. The arithmetic mean filtering method has the following characteristics: when the value of N is larger, the smoothness of the signal is higher, but the sensitivity is lower, and when the value of N is smaller, the smoothness of the signal is lower, but the sensitivity is higher. In this embodiment, the sensitivity of the system is required to be relatively high. The interference signal is a maximum value which appears randomly, so the requirement on signal smoothness is low, and therefore a small N value is selected here, the value of N in the paper is 3, and the requirement of the system can be well met.
The electronic musical instrument is characterized in that a plurality of ultrasonic sensors are arranged at different positions of the main body, and an ATMEGA168 processor is used for controlling grouping alternate triggering, data acquisition and data processing of the sensors, so that a multi-ultrasonic-sensor triggering system is constructed. The system has the advantages of low cost, high precision and good real-time performance. The method can be applied to the field of electronic musical instruments, and provides reliable basis for the design of colorful electronic devices.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above embodiments only express a few embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent should be subject to the appended claims.
Claims (10)
1. An electronic musical instrument is characterized by comprising a main body, a processor and at least two sensor groups, wherein each sensor group is arranged on the main body respectively, any one sensor group comprises at least two non-contact sensors, and each non-contact sensor in each sensor group is connected with the processor respectively; each non-contact sensor corresponds to an identity mark;
the processor starts timing when receiving a working instruction, takes any one of the sensor groups as a current sensor group, triggers the current sensor group to work, and transmits a first signal, when the non-contact sensor in the current sensor group receives a first return signal corresponding to the first signal within a preset time range after the start of timing, the processor obtains a first hitting distance according to the receiving time of the first return signal and the transmitting time of the first signal, and triggers the non-contact sensor to transmit a second signal after receiving the preset threshold duration of the first return signal, when a second return signal corresponding to the transmitted second signal is received within the preset time length range, the processor obtains a second hitting distance according to the receiving time of the second return signal and the transmitting time of the second signal, obtaining the striking speed according to the first striking distance, the second striking distance and the preset threshold duration, the processor sends out sound with tone corresponding to the identity mark and volume corresponding to the striking speed according to the identity mark of the non-contact sensor and the striking speed, when the count value of a counter preset by the processor reaches a preset number, the timing time reaches the preset time, the current sensor group is stopped from transmitting signals, the count value of the counter is cleared, timing is restarted, taking any one of the sensor groups except the current sensor group in each sensor group as the current sensor group, and returning to trigger the current sensor group to transmit a signal;
and generating an interrupt instruction every preset interval time when the processor receives the working instruction, and increasing the count value by 1 every time the processor receives the interrupt instruction.
2. The electronic musical instrument of claim 1, wherein a distance between each of the non-contact sensors in any one of the sensor groups is greater than a predetermined tamper-proof distance.
3. The electronic musical instrument of claim 1 wherein a timer is cleared after the preset trigger interval to stop operation of the current sensor set.
4. The electronic musical instrument of claim 1 wherein the preset threshold duration is less than the preset duration.
5. The electronic musical instrument according to claim 1, wherein the non-contact sensor is an ultrasonic sensor.
6. The electronic musical instrument according to claim 1, wherein the non-contact sensor includes an ultrasonic transmitter and an ultrasonic receiver, and the processor is connected to the ultrasonic generator and the ultrasonic receiver, respectively;
in the step of triggering the current sensor group to work and transmitting a first signal, respectively triggering ultrasonic transmitters of all non-contact sensors in the current sensor group to transmit ultrasonic signals;
and receiving a first return signal corresponding to the first signal through the ultrasonic receiver, wherein the first return signal is a return signal corresponding to the first ultrasonic signal.
7. The electronic musical instrument according to claim 6, further comprising a filter circuit through which the ultrasonic receiver is connected to the processor.
8. The electronic musical instrument according to claim 1, wherein the processor stops each of the sensor groups from operating upon receiving a stop instruction.
9. The electronic musical instrument according to claim 1, wherein the sensor groups are three in number, and include a first sensor group in which the number of the non-contact sensors is three, a second sensor group in which the number of the non-contact sensors is two, and a third sensor group in which the number of the non-contact sensors is two, respectively.
10. The electronic musical instrument according to claim 1, further comprising a first sound generating device and a second sound generating device connected to the processor, respectively, the first sound generating device and the second sound generating device being disposed opposite to each other in the main body, and the processor generates corresponding sounds through the first sound generating device and the second sound generating device, respectively, in the processor generating the corresponding sounds.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711480700.5A CN107945778B (en) | 2017-12-29 | 2017-12-29 | Electronic musical instrument |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711480700.5A CN107945778B (en) | 2017-12-29 | 2017-12-29 | Electronic musical instrument |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107945778A CN107945778A (en) | 2018-04-20 |
CN107945778B true CN107945778B (en) | 2023-04-07 |
Family
ID=61938016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711480700.5A Active CN107945778B (en) | 2017-12-29 | 2017-12-29 | Electronic musical instrument |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107945778B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108735191B (en) * | 2018-08-24 | 2023-11-03 | 张洋 | Non-contact percussion instrument |
CN111754966A (en) * | 2019-03-26 | 2020-10-09 | 曾耀君 | Electronic musical instrument and method of using the same |
CN113409748A (en) * | 2021-07-13 | 2021-09-17 | 武汉东南乾丰恒裕工程有限责任公司 | Ultrasonic string-free musical instrument for enlightenment teaching |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105161088A (en) * | 2015-09-30 | 2015-12-16 | 得理电子(上海)有限公司 | Capacitive-touch-based detection apparatus, and vibration detection system and method of electronic musical instrument |
JP2017062358A (en) * | 2015-09-25 | 2017-03-30 | カシオ計算機株式会社 | Sound controller, method, program, and electronic musical instrument |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5567902A (en) * | 1995-01-06 | 1996-10-22 | Baldwin Piano And Organ Company | Method and apparatus for optically sensing the position and velocity of piano keys |
JP4135275B2 (en) * | 1998-10-05 | 2008-08-20 | ヤマハ株式会社 | Speed detection apparatus and speed detection method |
JP3772674B2 (en) * | 2001-01-25 | 2006-05-10 | ヤマハ株式会社 | Electronic percussion instrument |
CN100474289C (en) * | 2003-09-19 | 2009-04-01 | 欧姆龙株式会社 | Multiple sensor system |
JP4244916B2 (en) * | 2004-12-06 | 2009-03-25 | ヤマハ株式会社 | Pronunciation control method based on performance prediction and electronic musical instrument |
EP2781922A4 (en) * | 2011-11-14 | 2015-04-08 | Fujitsu Ltd | Electronic apparatus, portable terminal and speed measuring method |
CN103192769B (en) * | 2012-01-10 | 2015-04-01 | 上海工程技术大学 | Vehicle safety volume adjustment system |
JP5949879B2 (en) * | 2014-11-17 | 2016-07-13 | カシオ計算機株式会社 | Touch detection device, touch detection method, and electronic musical instrument |
CN106802715A (en) * | 2016-12-30 | 2017-06-06 | 珠海市魅族科技有限公司 | Electronic equipment and its method for sensing |
CN107464548A (en) * | 2017-08-03 | 2017-12-12 | 京东方科技集团股份有限公司 | Contactless music sensing device and musical performance method |
-
2017
- 2017-12-29 CN CN201711480700.5A patent/CN107945778B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017062358A (en) * | 2015-09-25 | 2017-03-30 | カシオ計算機株式会社 | Sound controller, method, program, and electronic musical instrument |
CN105161088A (en) * | 2015-09-30 | 2015-12-16 | 得理电子(上海)有限公司 | Capacitive-touch-based detection apparatus, and vibration detection system and method of electronic musical instrument |
Also Published As
Publication number | Publication date |
---|---|
CN107945778A (en) | 2018-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107945778B (en) | Electronic musical instrument | |
Dey et al. | Ultrasonic sensor based smart blind stick | |
CN113253287A (en) | Object movement detection apparatus and method, and non-transitory computer-readable storage medium | |
CN118484106A (en) | Automatic calibration of acoustic stimulation signals for ultrasonic touch sensors | |
CN118012287A (en) | Ultrasonic touch sensor using capacitive crosstalk | |
CN205785491U (en) | A kind of Sound speed profile instrument based on TOF technology | |
TW201905489A (en) | Device for accurately detecting biodynamic characteristics or object fretting | |
CN1241712A (en) | Method of reducing blind zone of supersonic range finder | |
Akpan et al. | The Development of an Enhanced Obstacle Detection System with Alarm Based on the Internet-of-Things | |
US12056317B2 (en) | Under water touch detection with ultrasonic sensors using capacitive micromachined ultrasonic transducers (CMUTs) | |
Zhi et al. | Design of distance measuring and reversing system | |
CN105823548A (en) | Sound velocity profiler based on TOF technology | |
KR20070087877A (en) | Reverberation eliminating method of the ultrasonic transmitting driver | |
US12099685B2 (en) | Water rejection mechanism for ultrasonic touch sensors based on individually processed interfaces | |
US20240192809A1 (en) | Capacitive micromachined ultrasonic transducer (cmut) multi-touch and slider detection with improved pixel area coverage and ultrasonic feedback by a same pixel array | |
AU5441899A (en) | Method and system for measuring the distance from a piezoelectric element | |
US12124655B2 (en) | Ultrasonic touch sensors and capacitive pressure sensing microelectromechanical system fusion | |
US20240094850A1 (en) | Ultrasonic touch sensors and capacitive pressure sensing microelectromechanical system fusion | |
CN219319571U (en) | Sound velocity measuring circuit of time leap type sound velocity meter | |
Saraf et al. | An IVR based intelligent guidance stick for blind | |
CN202587178U (en) | Television anti-myopia early warning system based on ultrasonic ranging | |
CN118151744A (en) | Underwater touch detection with ultrasonic sensor using Capacitive Micromachined Ultrasonic Transducer (CMUT) | |
Yang et al. | Calibration of echosounder using standard target method | |
CN117724623A (en) | Ultrasonic touch sensor and capacitive pressure sensing micro-electromechanical system fusion | |
JP2002358157A (en) | Coordinate inputting device and method for controlling the same device and program for controlling the same device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |