A kind of control method of music buzzing, system and corresponding electronic product
Technical field
The invention belongs to electronic applications, relate in particular to a kind of control method, system and corresponding electronic product of music buzzing.
Background technology
In electronic product, have a lot of places and need to use buzzer or musical sound, such as startup music and the shutdown music of the washing machine of household appliances, dish-washing machine, smoke exhaust ventilator etc., the chimes of doom of each electronic product or prompting sound, button note (such as ding-dong) etc.
For the music in electronic product, general way is exactly frequency meter and the corresponding beat by this music.This way, defective is: 1, when changing hummer (as the frequency size), when perhaps the MCU resource adjusts (such as the tick source that produces minimum chronomere is not enough), must change each frequency values in the music frequency table, this pretty troublesome (the change amount is larger) and easily make mistakes (omit or miscalculate).2, to requiring to change the product of music, must be by requiring the presenter to frequency corresponding to each beat of music that make new advances, the comparatively difficulty thereby change is got up.
Summary of the invention
In order to address the above problem, the object of the present invention is to provide a kind of control method of music buzzing.
The present invention is achieved in that a kind of control method of music buzzing, said method comprising the steps of:
Dividing the frequency range of hummer into 13 sections carries out corresponding one by one with 13 basic scales of music;
When utilizing described hummer to play music, the music notation of reading pre-stored, and find one by one the frequency of corresponding hummer according to the scale of music notation record;
Control hummer and carry out work according to the frequency of correspondence.
Further, described method is further comprising the steps of:
According to the scale of music notation record, control hummer in time that respective frequencies is rung.
Further, described frequency range with hummer divides 13 sections 13 basic scales with music into and carries out one to one that step comprises the following steps:
The whole frequency range of hummer on average is divided into 13 sections;
Make each band frequency after dividing equally carry out corresponding with a basic scale of music.
Another purpose of the present invention is to provide a kind of control system of music buzzing, and described system comprises:
Scale frequency respective modules divides the frequency range of hummer into 13 sections and carries out corresponding one by one with 13 basic scales of music;
Frequency is searched module, when being used for utilizing described hummer to play music, and the music notation of reading pre-stored, and find one by one the frequency of corresponding hummer according to the scale of music notation record;
The control module of ringing is used for controlling hummer and carries out work according to the frequency of correspondence.
Further, described system also comprises:
The ringing time control module is used for the scale according to the music notation record, controls hummer in time that respective frequencies is rung.
Further, described scale frequency respective modules comprises:
Frequency averaging is divided module, is used for the whole frequency range of hummer on average is divided into 13 sections;
Respective modules, be used for making each band frequency after dividing equally carry out corresponding with a basic scale of music one by one.
Another purpose of the present invention is to provide a kind of electronic product, and described electronic product comprises hummer, and described electronic product also comprises the control system of above-mentioned music buzzing.
In the present invention, divide the frequency range of hummer into 13 sections and carry out correspondingly one by one with 13 basic scales of music, and find one by one the frequency of corresponding hummer according to the scale of music notation record, carry out work thereby control hummer according to the frequency of correspondence.The control method of this music buzzing is fit to various music.To different products, change song, perhaps increase a piece of music, very simple, as long as the music notation that you want is put in.And need not the hummer frequency of knowing that each beat of this song is corresponding.And the versatility of the method, very good, (be fit to very long music, also being fit to very short is exactly even the sound requirement of a note, can be also a certain section or a certain sentence of certain song) succinctly and flexibly.And the method is to hardware capabilities size requirements low (code is few, saves the MCU memory headroom), and is maintainable fine.
Description of drawings
Fig. 1 is the control method process flow diagram of the music buzzing that provides of the embodiment of the present invention;
Fig. 2 is the block diagram of the control system of the music buzzing that provides of the embodiment of the present invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
Fig. 1 shows the flow process of the control method of the music buzzing that the embodiment of the present invention provides, and details are as follows:
In step S101, divide the frequency range of hummer into 13 sections and carry out corresponding one by one with 13 basic scales of music.
In step S102, when utilizing described hummer to play music, the music notation of reading pre-stored, and find one by one the frequency of corresponding hummer according to the scale of music notation record.
In step S103, control hummer and carry out work according to the frequency of correspondence.
As embodiments of the invention, the method is further comprising the steps of: according to the scale of music notation record, control hummer in time that respective frequencies is rung.
As embodiments of the invention, described frequency range with hummer divides 13 sections 13 basic scales with music into and carries out one to one that step comprises the following steps: the whole frequency range of hummer on average is divided into 13 sections; Make each band frequency after dividing equally carry out corresponding with a basic scale of music.
Fig. 2 shows the structure of the control system of the music buzzing that the embodiment of the present invention provides, and this system comprises: scale frequency respective modules 21, frequency are searched module 22 and the control module 23 of ringing.The control system of this music buzzing can be software unit or hardware cell or the unit soft, that scleroma is closed that is built in the electronic product that comprises hummer.
Scale frequency respective modules 21 divides the frequency range of hummer into 13 sections and carries out corresponding one by one with 13 basic scales of music; Frequency is searched module 22 when utilizing described hummer to play music, the music notation of reading pre-stored, and find one by one the frequency of corresponding hummer according to the scale of music notation record; The control module of ringing 23 is controlled hummer and is carried out work according to the frequency of correspondence.
As embodiments of the invention, described system also comprises: ringing time control module 24.This ringing time control module 24 is according to the scale of music notation record, controls hummer in time that respective frequencies is rung.
As embodiments of the invention, described scale frequency respective modules comprises again: frequency averaging is divided module 211 and respective modules 212 one by one.This frequency averaging division module 211 on average is divided into 13 sections with the whole frequency range of hummer, and respective modules 212 makes each band frequency after dividing equally carry out corresponding with a basic scale of music one by one.
In the present invention, 13 basic scales (7 basic scales add 6 half beats) take this hummer frequency range as far as possible, to realize maximum range.Certainly, also can the beat that will use, be placed near this hummer nominal frequency according to the music requirement of specific product as far as possible, the loudest to realize sound.
In sum, the control method of this music buzzing is fit to various music.To different products, change song, perhaps increase a piece of music, very simple, as long as the music notation that you want is put in.And need not the hummer frequency of knowing that each beat of this song is corresponding.And the versatility of the method, very good, (be fit to very long music, also being fit to very short is exactly even the sound requirement of a note, can be also a certain section or a certain sentence of certain song) succinctly and flexibly.And the method is to hardware capabilities size requirements low (code is few, saves the MCU memory headroom), and is maintainable fine.
The above is only preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., within all should being included in protection scope of the present invention.