Method for controlling light to change along with music
By analyzing music signals into frequency bands and controlling the lighting position and brightness changes of the LED array, the problem of vehicle grille lights not being able to play music randomly was solved, realizing dynamic changes in light according to music frequency and amplitude, and enhancing the interactivity of the light show.
Patent Information
- Application Number
- CN202411258252.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-12
AI Technical Summary
The existing vehicle grille light music light show cannot play music randomly and jump synchronously; the light effect is fixed and cannot change with the frequency and amplitude of the music.
The music signal is analyzed into ten frequency bands and sent to the LED lights via the CANFD bus. The lighting position and brightness of the LED array are controlled, and the lights change synchronously with the music according to the music frequency and amplitude.
It enables the lights to dynamically change with the frequency and amplitude of the music, enhancing the randomness and interactivity of the light show.
Smart Images

Figure CN118945956A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of LED lamps, and in particular to a method for controlling light to change with music. Background Art
[0002] Currently, many music light shows for vehicle grille lights on the market play a few fixed pieces of music, and the dynamic effects of the lights also correspond to the effects of the fixed pieces of music. It is impossible to achieve the effect of randomly playing a piece of music and having the lights dance to the random music. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a control method for changing light with music, wherein the light can change with the frequency and amplitude of the music.
[0004] In order to solve the above technical problems, the technical solution of the present invention is: a method for controlling lights to change with music, comprising the following steps:
[0005] (1) Music audio signal analysis: The music encoding data is decomposed into audio data of different frequency bands, and the frequency range of 20HZ-20KHZ is divided into ten frequency bands. The first frequency band is 20-120HZ, the second frequency band is 120HZ-240HZ, the third frequency band is 240HZ-480HZ, the fourth frequency band is 480-800HZ, the fifth frequency band is 800HZ-1200HZ, the sixth frequency band is 1200HZ-1500HZ, the seventh frequency band is 1.5KHZ-2KHZ, the eighth frequency band is 2K-3KHZ, and the ninth frequency band is 480-800HZ. The first frequency band is 3K-10KHZ, and the tenth frequency band is 10K-20KHZ; these ten frequency band data are sent to the LED light through the CANFD bus, one byte corresponds to the data of one frequency band, this data is the audio signal amplitude, the value range is 0-255, the data of CANFD message byte Data00 corresponds to the first frequency band 20-120HZ, the data of Data01 corresponds to the second frequency band 120HZ-240HZ, and so on, until Data09 data corresponds to the tenth frequency band 10K-20KHZ, the message sending cycle is 100ms per frame;
[0006] (2) Control of the position of the lit LEDs: The data of the ten frequency bands are matched to the LED arrays in the LED lamps. From left to right, the first column of LEDs corresponds to the first frequency band, the second column of LEDs corresponds to the second frequency band, the third column of LEDs corresponds to the third frequency band, the fourth column of LEDs corresponds to the fourth frequency band, the fifth column of LEDs corresponds to the fifth frequency band, the sixth column of LEDs corresponds to the sixth frequency band, the seventh column of LEDs corresponds to the seventh frequency band, the eighth column of LEDs corresponds to the eighth frequency band, the ninth column of LEDs corresponds to the ninth frequency band, and the tenth column of LEDs corresponds to the tenth frequency band; the nine amplitude data of the audio signal are matched to the first frequency band, the second column of LEDs corresponds to the second frequency band, the third column of LEDs corresponds to the third frequency band, the fourth column of LEDs corresponds to the fourth frequency band, the fifth column of LEDs corresponds to the fifth frequency band, the sixth column of LEDs corresponds to the sixth frequency band, the seventh column of LEDs corresponds to the seventh frequency band, the eighth column of LEDs corresponds to the eighth frequency band, the ninth column of LEDs corresponds to the ninth frequency band, and the tenth column of LEDs corresponds to the tenth frequency band; The range corresponds to the LED array in the LED lamp. From bottom to top, the first row of LEDs corresponds to an amplitude range of 0-20, the second row of LEDs corresponds to an amplitude range of 21-40, the third row of LEDs corresponds to an amplitude range of 41-60, the fourth row of LEDs corresponds to an amplitude range of 61-80, the fifth row of LEDs corresponds to an amplitude range of 81-100, the sixth row of LEDs corresponds to an amplitude range of 101-120, the seventh row of LEDs corresponds to an amplitude range of 121-140, the eighth row of LEDs corresponds to an amplitude range of 141-160, and the ninth row of LEDs corresponds to an amplitude range of 161-255;
[0007] (3) When the LED lamp receives a frame of CANFD message data at a certain moment, the LED in the column corresponding to the frequency band and the row corresponding to the amplitude range is lit, and the LED below the LED needs to be lit synchronously.
[0008] As an improvement, the LED lamp receives the message period of 100ms per frame, and the lighting time of the LED lamp is refreshed once after receiving data, that is, it is refreshed every 100ms. The time of receiving the message is t0. Suppose the lighting time of the first row of LEDs is t0, the lighting time of the second row of LEDs is t0+10ms, the lighting time of the third row of LEDs is t0+20ms, the lighting time of the fourth row of LEDs is t0+30ms, the lighting time of the fifth row of LEDs is t0+40ms, the lighting time of the sixth row of LEDs is t0+50ms, the lighting time of the seventh row of LEDs is t0+60ms, the lighting time of the eighth row of LEDs is t0+70ms, and the lighting time of the ninth row of LEDs is t0+80ms. After the LEDs are lit, they remain on until the next frame of message is received and then all go out. Then the corresponding LEDs are lit according to the new message data.
[0009] As an improvement, the brightness of the lit LED changes according to the message time, and is calculated with 5 message cycles, i.e. 500ms, as a group of time periods:
[0010] In the first message cycle, the first row of LEDs is lit at a duty cycle of 50%, the second row is lit at a duty cycle of 45%, and the brightness decreases by 5% upwards until the top row of LEDs is lit at a duty cycle of 10%;
[0011] In the second message cycle, the first row of LEDs from the bottom has a 75% duty cycle, the second row has a 70% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 35% duty cycle.
[0012] In the third message cycle, the first row of LEDs from the bottom has a 100% duty cycle, the second row has a 95% duty cycle, and the brightness decreases by 5% upwards until the top row has a 60% duty cycle.
[0013] In the fourth message cycle, the first row of LEDs from the bottom has a 75% duty cycle, the second row has a 45% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 35% duty cycle.
[0014] In the fifth message cycle, the first row of LEDs from the bottom has a 50% duty cycle, the second row has a 45% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 10% duty cycle.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] According to the LED light receiving a frame of CANFD message data at a certain moment, the LED in the column corresponding to the frequency band and the row corresponding to the amplitude range is lit, and the light can change with the frequency and amplitude of the music. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 The frequency band and amplitude distribution diagram corresponding to the grille light LED array.
[0018] Figure 2 The figure is a schematic diagram of the LED lighting position for a specific example. DETAILED DESCRIPTION
[0019] The present invention will be further described below in conjunction with the accompanying drawings.
[0020] A method for controlling light changes with music, applied to a car grille light, comprises the following steps:
[0021] (1) Music audio signal analysis: Figure 1As shown, the music encoding data is decomposed into audio data of different frequency bands, and the frequency range of 20HZ-20KHZ that can be heard by the human ear is divided into ten frequency bands, the first frequency band is 20-120HZ, the second frequency band is 120HZ-240HZ, the third frequency band is 240HZ-480HZ, the fourth frequency band is 480-800HZ, the fifth frequency band is 800HZ-1200HZ, the sixth frequency band is 1200HZ-1500HZ, the seventh frequency band is 1.5KHZ-2KHZ, the eighth frequency band is 2K-3KHZ, and the ninth frequency band is 480-800HZ. The first frequency band is 3K-10KHZ, and the tenth frequency band is 10K-20KHZ; these ten frequency band data are sent to the LED light through the CANFD bus, one byte corresponds to the data of one frequency band, this data is the audio signal amplitude, the value range is 0-255, the data of CANFD message byte Data00 corresponds to the first frequency band 20-120HZ, the data of Data01 corresponds to the second frequency band 120HZ-240HZ, and so on, until Data09 data corresponds to the tenth frequency band 10K-20KHZ, the message sending cycle is 100ms per frame;
[0022] (2) LED lighting position control: Figure 1 As shown, the data of the ten frequency bands correspond to the LED array in the LED lamp. From left to right, the first column of LEDs corresponds to the first frequency band, the second column of LEDs corresponds to the second frequency band, the third column of LEDs corresponds to the third frequency band, the fourth column of LEDs corresponds to the fourth frequency band, the fifth column of LEDs corresponds to the fifth frequency band, the sixth column of LEDs corresponds to the sixth frequency band, the seventh column of LEDs corresponds to the seventh frequency band, the eighth column of LEDs corresponds to the eighth frequency band, the ninth column of LEDs corresponds to the ninth frequency band, and the tenth column of LEDs corresponds to the tenth frequency band; the nine amplitude data ranges of the audio signal correspond to the LED array in the LED lamp. From bottom to top, the first row of LEDs corresponds to the amplitude range of 0-20 , the second row of LEDs corresponds to an amplitude range of 21-40, the third row of LEDs corresponds to an amplitude range of 41-60, the fourth row of LEDs corresponds to an amplitude range of 61-80, the fifth row of LEDs corresponds to an amplitude range of 81-100, the sixth row of LEDs corresponds to an amplitude range of 101-120, the seventh row of LEDs corresponds to an amplitude range of 121-140, the eighth row of LEDs corresponds to an amplitude range of 141-160, and the ninth row of LEDs corresponds to an amplitude range of 161-255; according to the LED light receiving a frame of CANFD message data at a certain moment, the LED in the column where the corresponding frequency segment is located and the row where the corresponding amplitude range is located is lit, and the LED below the LED needs to be lit synchronously;
[0023] (3) LED lighting time control: The LED lamp receives a message at a cycle of 100 ms per frame. The LED lamp is refreshed once after receiving data, that is, it is refreshed every 100 ms. The message receiving time is t0. Let the first row of LEDs light up at t0, the second row of LEDs light up at t0+10ms, the third row of LEDs light up at t0+20ms, the fourth row of LEDs light up at t0+30ms, the fifth row of LEDs light up at t0+40ms, the sixth row of LEDs light up at t0+50ms, the seventh row of LEDs light up at t0+60ms, the eighth row of LEDs light up at t0+70ms, and the ninth row of LEDs light up at t0+80ms. After the LEDs are lit, they remain on until the next frame of message is received, and then all of them are turned off. Then, the corresponding LEDs are lit according to the new message data.
[0024] (4) Brightness control of lit LED: The brightness of the lit LED does not remain constant. Its duty cycle changes according to the message time. It is calculated based on 5 message cycles, i.e. 500ms, as a group of time periods:
[0025] In the first message cycle, the first row of LEDs is lit at a duty cycle of 50%, the second row is lit at a duty cycle of 45%, and the brightness decreases by 5% upwards until the top row of LEDs is lit at a duty cycle of 10%;
[0026] In the second message cycle, the first row of LEDs from the bottom has a 75% duty cycle, the second row has a 70% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 35% duty cycle.
[0027] In the third message cycle, the first row of LEDs from the bottom has a 100% duty cycle, the second row has a 95% duty cycle, and the brightness decreases by 5% upwards until the top row has a 60% duty cycle.
[0028] In the fourth message cycle, the first row of LEDs from the bottom has a 75% duty cycle, the second row has a 45% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 35% duty cycle.
[0029] In the fifth message cycle, the first row of LEDs from the bottom has a 50% duty cycle, the second row has a 45% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 10% duty cycle.
[0030] like Figure 2As shown, a specific example: if the headlight receives a frame of CANFD message data as shown in Table 1 at a certain moment, the position of the lit LED should be the 1st row from the bottom of the 1st column from the left; the 1st and 2nd rows of the 2nd column; the 1st, 2nd and 3rd rows of the 3rd column; the 1st, 2nd and 3rd rows of the 4th column; the 1st, 2nd and 3rd rows of the 4th column; the 1st, 2nd and 3rd rows of the 4th column; the 1st, 2nd and 3rd rows of the 5th column; the 1st, 2nd and 3rd rows of the 6th column; the 1st, 2nd and 3rd rows of the 4 ...
[0031] Table 1
[0032]
Claims
1. A method for controlling lighting changes with music, characterized in that: The following steps are involved: (1) Music audio signal analysis: The music encoding data is decomposed into audio data of different frequency bands, and the frequency range of 20HZ-20KHZ is divided into ten frequency bands. The first frequency band is 20-120HZ, the second frequency band is 120HZ-240HZ, the third frequency band is 240HZ-480HZ, the fourth frequency band is 480-800HZ, the fifth frequency band is 800HZ-1200HZ, the sixth frequency band is 1200HZ-1500HZ, the seventh frequency band is 1.5KHZ-2KHZ, the eighth frequency band is 2K-3KHZ, and the ninth frequency band is 480-800HZ. The first frequency band is 3K-10KHZ, and the tenth frequency band is 10K-20KHZ; these ten frequency band data are sent to the LED light through the CANFD bus, one byte corresponds to the data of one frequency band, this data is the audio signal amplitude, the value range is 0-255, the data of CANFD message byte Data00 corresponds to the first frequency band 20-120HZ, the data of Data01 corresponds to the second frequency band 120HZ-240HZ, and so on, until Data09 data corresponds to the tenth frequency band 10K-20KHZ, the message sending cycle is 100ms per frame; (2) Control of the position of the lit LEDs: The data of the ten frequency bands are matched to the LED arrays in the LED lamps. From left to right, the first column of LEDs corresponds to the first frequency band, the second column of LEDs corresponds to the second frequency band, the third column of LEDs corresponds to the third frequency band, the fourth column of LEDs corresponds to the fourth frequency band, the fifth column of LEDs corresponds to the fifth frequency band, the sixth column of LEDs corresponds to the sixth frequency band, the seventh column of LEDs corresponds to the seventh frequency band, the eighth column of LEDs corresponds to the eighth frequency band, the ninth column of LEDs corresponds to the ninth frequency band, and the tenth column of LEDs corresponds to the tenth frequency band; the nine amplitude data of the audio signal are matched to the first frequency band, the second column of LEDs corresponds to the second frequency band, the third column of LEDs corresponds to the third frequency band, the fourth column of LEDs corresponds to the fourth frequency band, the fifth column of LEDs corresponds to the fifth frequency band, the sixth column of LEDs corresponds to the sixth frequency band, the seventh column of LEDs corresponds to the seventh frequency band, the eighth column of LEDs corresponds to the eighth frequency band, the ninth column of LEDs corresponds to the ninth frequency band, and the tenth column of LEDs corresponds to the tenth frequency band; The range corresponds to the LED array in the LED lamp. From bottom to top, the first row of LEDs corresponds to an amplitude range of 0-20, the second row of LEDs corresponds to an amplitude range of 21-40, the third row of LEDs corresponds to an amplitude range of 41-60, the fourth row of LEDs corresponds to an amplitude range of 61-80, the fifth row of LEDs corresponds to an amplitude range of 81-100, the sixth row of LEDs corresponds to an amplitude range of 101-120, the seventh row of LEDs corresponds to an amplitude range of 121-140, the eighth row of LEDs corresponds to an amplitude range of 141-160, and the ninth row of LEDs corresponds to an amplitude range of 161-255; (3) When the LED lamp receives a frame of CANFD message data at a certain moment, the LED in the column corresponding to the frequency band and the row corresponding to the amplitude range is lit, and the LED below the LED needs to be lit synchronously.
2. A method for controlling light changes with music according to claim 1, characterized in that: The cycle of LED lights receiving messages is 100ms per frame. The lighting time of LED lights is refreshed once after receiving data, that is, it is refreshed every 100ms. The time of receiving the message is t0. Suppose the lighting time of the first row of LEDs is t0, the lighting time of the second row of LEDs is t0+10ms, the lighting time of the third row of LEDs is t0+20ms, the lighting time of the fourth row of LEDs is t0+30ms, the lighting time of the fifth row of LEDs is t0+40ms, the lighting time of the sixth row of LEDs is t0+50ms, the lighting time of the seventh row of LEDs is t0+60ms, the lighting time of the eighth row of LEDs is t0+70ms, and the lighting time of the ninth row of LEDs is t0+80ms. After the LEDs are lit, they remain on until the next frame of message is received, and then they are all extinguished, and then the corresponding LEDs are lit according to the new message data.
3. The method for controlling light changes with music according to claim 1, characterized in that: The brightness of the lit LED changes according to the message time, and is calculated based on 5 message cycles, i.e. 500ms, as a time period: In the first message cycle, the first row of LEDs is lit at a duty cycle of 50%, the second row is lit at a duty cycle of 45%, and the brightness decreases by 5% upwards until the top row of LEDs is lit at a duty cycle of 10%; In the second message cycle, the first row of LEDs from the bottom has a 75% duty cycle, the second row has a 70% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 35% duty cycle. In the third message cycle, the first row of LEDs from the bottom has a 100% duty cycle, the second row has a 95% duty cycle, and the brightness decreases by 5% upwards until the top row has a 60% duty cycle. In the fourth message cycle, the first row of LEDs from the bottom has a 75% duty cycle, the second row has a 45% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 35% duty cycle. In the fifth message cycle, the first row of LEDs from the bottom has a 50% duty cycle, the second row has a 45% duty cycle, and the brightness decreases by 5% upwards until the top row of LEDs has a 10% duty cycle.
