Summary of the invention
The embodiment of the present application provides a kind of method, apparatus based on music animation and storage equipment.It solves existing
It can only the simply preset animation problem of shuffle in technology.
The embodiment of the present application provides a kind of method based on music animation, and this method includes:
Identify music dimensional information;
The music dimensional information is converted into the first mood value;
According to the first mood value playing animation.
Further, above-mentioned the music dimensional information is converted into the first mood value to include:
The music dimensional information is converted to the second mood value according to the weight of dimension values each in music dimensional information;
The second mood value is added to obtain the first mood value.
Further, above-mentioned to include according to the first mood value playing animation:
The first mood value is converted into emotional characteristics figure using neural network;
According to the emotional characteristics figure playing animation.
Further, above-mentioned to include according to the emotional characteristics figure playing animation:
Emotional characteristics figure is mapped to animated element, sports rule and color value according to mapping ruler;
According to animated element, sports rule and color value playing animation.
Further, above-mentioned mapping ruler includes:
The corresponding relationship of emotional characteristics figure and default animated element, predetermined movement rule and pre-set color value.
Further, above-mentioned to include according to animated element, sports rule and color value playing animation:
Random () function is called to generate random number according to emotional characteristics figure;
Default animated element, predetermined movement rule and pre-set color value, playing animation are called according to random number.
Further, this method further includes:
In the second preset time in the first preset time after music starts and at the end of apart from music, playing animation
Foreshadowing painted eggshell.
Further, above-mentioned music dimensional information includes:It is music rhythm, strong and weak duration, climax paragraph, popular colour, current
The total playing duration of music, current volume, present reality life-time, light level data, infrared sensor and rhythm sound
At least one of triggering.
The embodiment of the present application also provides a kind of storage equipment, are stored thereon with program data, and described program data are used for
The above-mentioned method based on music animation is realized when being executed by processor.
The embodiment of the present application also provides a kind of device based on music animation, which includes:
Equipment is stored, for storing program data;
Processor, it is above-mentioned based on music animation to realize for executing the program data in the storage equipment
Method.
The beneficial effect that the application can obtain is that different music can automatically generate different animation effects to match
Scene atmosphere is closed, the manpower and material resources of exploitation animation are reduced.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the application specific embodiment and
Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one
Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
Fig. 1 is computer composed structure block diagram, and the main component of computer is shown.It is processor 110, interior in Fig. 1
115 access system bus 140 of portion's memory 105, bus bridge 120 and network interface, bus bridge 120 are used for bridge system bus
140 and I/O bus 145, I/O interface access I/O bus 145, and USB interface and external memory are connect with I/O interface.Fig. 1
In, processor 110 can be one or more processors, and each processing can have one or more processor cores;It is interior
Portion's memory 105 is volatile memory, such as register, buffer, various types of random access memory etc.;It is calculating
When machine booting operation, the data in internal storage 105 include operating system and application program;Network interface 115 can be with
For Ethernet interface, optical fiber interface etc.;System bus 140 can be used to data information, address information and control letter
Breath;Bus bridge 120 can be used to carry out protocol conversion, system bus protocol is converted to I/O agreement or by I/O protocol conversion
It is system bus protocol to realize that data are transmitted;I/O bus 145 is used to data information and control information, can be with bus termination
Resistance or circuit interfere to reduce signal reflex;I/O interface 130 is mainly connect with various external equipments, for example, keyboard, mouse,
Sensor etc., flash memory can access I/O bus by USB interface, and external memory is nonvolatile memory, such as firmly
Disk, CD etc..After power the computer, processor can will be stored in external storage reading data therein to storage inside
In device, and storage inside computer instruction therein is handled, completes the function of operating system and application program.This shows
Example computer can be desktop computer, laptop, tablet computer, smart phone etc..
Fig. 2 is a kind of flow chart of the method based on music animation provided by the embodiments of the present application, the flow chart packet
It includes:
Step 205, music dimensional information is identified;
Different music can automatically generate different animation effects to cooperate scene atmosphere.Same song, in difference
Under conditions of have different animation effect.And animation effect music dimensional information of combining closely has apparent animation to become
It is unreal.
In the present embodiment, it after recognizing music dimensional information, enters data into trained neural network.It is optional
Ground, music dimensional information include:It is music rhythm, strong and weak duration, climax paragraph, popular colour, the total playing duration of current music, current
At least one of volume, present reality life-time, light level data, infrared sensor and rhythm sounds trigger.It is logical
It crosses to acquire former seconds and assigns entire music rhythm budget after music, rhythm rate is constantly updated according to real-time music;Music
By interception the most frequently used frequency band of rhythmic music after several seconds, the strong and weak peak of sound intensity and the reduced value of low ebb, record are read
Music to specific strength, short time Strength Changes.In a short time, sound intensity significant change, with rhythm sound intensity before
The different sample of intensity;Illustrate herein, combining music rhythm and strong and weak two dimensions of duration, can correct music animation rhythm with
Rate.Climax music rhythm, melody are analyzed, the control of mood climax color atmosphere is triggered in climax point;Popular colour is according to current year
Popular colour, color matching library etc. do continuous renewal and iteration;Optionally, in the first preset time after music starts and apart from sound
In the second preset time at the end of pleasure, playing animation foreshadowing painted eggshell.It is local to obtain the total playing duration of current music, it is opened in music
Begin and animation foreshadowing painted eggshell is carried out in ending, animation is slow at beginning and end, and prelude and beginning light efficiency have color difference.This
Point is mainly for the difference on effect for having the music of prelude to do, and after music starts, audio is unidentified first to issue one section of face to voice
Color animation, and a colour switching, the view that voice generates in the prelude and music of prominent music can be triggered by then recognizing voice
Feel difference;In the present embodiment, animation foreshadowing painted eggshell is round flashing, first a small number of when music starts circular elements several times occur
Animation is as echoing, and effect is very lofty after being unlikely to.Rhythm and figure are slowly moved at the end of general music exits with dimmed
, but painted eggshell is that the prefabricated some special graphic animations of meeting do random triggering at ending, it is special that festivals or holidays can occur more at high proportion
Animation.The height of the current volume recognized sways the emotion the change of value, influences saturation degree, changes in temperature, the animation speed of atmosphere color
Spend speed and other effects;The color of music moods can be according to the present reality life-time and the bright dark degree of environment recognized, automatically
Adjust the brightness and saturation degree of color light;Light sensor recognizes current bright dark degree, adjusts atmosphere animation effect in real time
Fruit;Whether infrared sensor identification current spatial has mobiles, and in the state that judgement has mobiles, sensor can be identified
The direction of motion in mobiles direction, animation is moved towards the direction of mobiles;In the state of judging non-activity object, move
The direction of motion of picture is moved according to random effect;Microphone can be in pre- wake-up states, and rhythm sounds trigger is got in microphone knowledge
(sound of ambient enviroment).When recognizing regular sound or lasting voice, then judgement is people as music is regular
Music rhythm behavior, be considered as higher Emotion expression, color is more bright-coloured in visual effect, and animation amplitude becomes larger.
Above-mentioned neural network is manually to be marked (affective tag) by 10 dimensional informations to music, uses CNN
Algorithm carries out what model training obtained.
In the present embodiment, ten music dimensional information weights are:Music rhythm 25%, strong and weak duration 25%, climax section
The total playing duration 3% of 5%, popular colour 5%, current music, current volume 7%, present reality life-time 5%, light is fallen to pass
Feel data 10%, infrared sensor 5%, rhythm sounds trigger 10%.
Step 210, the music dimensional information is converted into the first mood value;
Data that trained neural network receives in step 205 that treated, handle it, obtain the first feelings
Thread value.
Optionally, the music dimensional information is converted to second according to the weight of dimension values each in music dimensional information
Mood value;The second mood value is added to obtain the first mood value
In the present embodiment, the corresponding eight moods classification of the first mood value:One, indignation is (such as indignant, worried, worried, tired
It is hot-tempered, indignant, animosity, hatred, it is furious, enrage, be angry, is venomous, being hostile to, bitterly hate and violence);Two, grief (is apt to as mostly anxious
Sense, self pity, loneliness, dejected, sad, sad, gloomy, melancholy, desperate, major depression);Three, frightened (such as worried, worried, tight
It opens, doubt, irritability, vigilance, flurried, anxiety, is on tenterhooks, fears, is terrified, neurosis up to morbid state, panic disorder, terror
Disease);Four, happy (such as to take pride in, is excited, joyful, happy, happy, happy, loosen, is wild with joy, free and unfettered comfortable, greatly delighted, sense organ
It is happy, perfectly contented, happy and pleased with oneself, follow one's bent, be mad with joy so that extreme is manic);Five, love (is such as respected the aged people kind young, very little
The careless light of spring, it is sincere, infatuated be sentimentally attached to, be close, loving at first sight, having mutual affinity, is loyal-hearted, sharing a common destiny, loyalty it is honest and just
Geng helps each other when both are in humble circumstances, unselfish care, reveres the feelings of admiring, is full of tenderness, finding each other congenial, licking calf);Six, surprised (such as strange, frightened
Be surprised, in surprise, shock etc.);Seven, ugly, it is honest (such as despise, scorn, disdaining, abhoing, disliking, is disagreeable);Eight, ashamed (such as embarrassed
Be stranded, disgrace, compunction, repent, is annoyed, ashamed etc.).
Step 215, according to the first mood value playing animation;
Optionally, the first mood value is converted into emotional characteristics figure using trained neural network;According to described
Emotional characteristics figure playing animation.
In the present embodiment, different animated elements, sports rule and color value are devised to different moods, there is one
Cover mapping ruler.This set of mapping ruler can be stored in program, when program gets different mood values, can be reflected by this set
It penetrates rule to go to get the animation effect for needing to show, effect has multiple combinations, goes out a kind of combination at random every time, then passes through
Single-chip microcontroller controls LED light to realize animation effect.
Further, emotional characteristics figure is mapped to by animated element, sports rule and color value according to mapping ruler;According to
Animated element, sports rule and color value playing animation.Still further, calling random () function according to emotional characteristics figure
Generate random number;Default animated element, predetermined movement rule and pre-set color value, playing animation are called according to random number.
In the present embodiment, above-mentioned mapping ruler (mapping ruler table as shown in Table 1 and Table 2) includes:Emotional characteristics figure
With the corresponding relationship of default animated element, predetermined movement rule and pre-set color value.Wherein, the quantity in Tables 1 and 2 is color
Number of primary colors.Infrared sensor recognizes in the state that current spatial do not have mobiles, according to mood described in emotional characteristics figure
Classification calls random () function to generate random number;Call default animated element, predetermined movement regular and default according to random number
Color value, playing animation;By taking mood is classified as indignation as an example, color, size, position and the direction of motion are fixed, brightness point
Three kinds of situations, in two kinds of situation, then the animation effect for corresponding to mood classification is divided into six kinds of situations to quantity, according to random ()
The random number that function generates plays one of animation effect, as shown in table 1;Infrared sensor, which recognizes current spatial, work
In the state of animal body, is classified according to mood described in emotional characteristics figure and random () function is called to generate random number;According to random
Number calls default animated element, predetermined movement rule and pre-set color value, playing animation;By taking mood is classified as indignation as an example, face
Color, size and location be it is fixed, brightness in two kinds of situation, quantity in two kinds of situation, animation towards mobiles direction move,
The animation effect for then corresponding to mood classification is divided into 4 kinds of situations, according to the random number that random () function generates, plays wherein
A kind of animation effect, as shown in table 2.
Table 1, mapping ruler table
Table 2, mapping ruler table
The beneficial effect that the application can obtain is that different music can automatically generate different animation effects to match
Scene atmosphere is closed, the manpower and material resources of exploitation animation are reduced.
Fig. 3 is a kind of structural schematic diagram of the device based on music animation provided by the embodiments of the present application, the structure
Schematic diagram includes storage equipment 305 and processor 310.
Equipment 305 is stored, for storing program data;
Processor, for executing the program data in the storage equipment to realize identification music dimensional information;It will be described
Music dimensional information is converted into the first mood value;According to the first mood value playing animation.
The embodiment of the present application also provides a kind of storage equipment, are stored thereon with program data, and described program data are used for
Identification music dimensional information is realized when being executed by processor;The music dimensional information is converted into the first mood value;According to institute
State the first mood value playing animation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.