Light effect control method, sound and atmosphere lamp device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN XINYANG CHUANGZHI TECHNOLOGY CO LTD
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-24
Smart Images

Figure CN122093997B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of lighting effect control technology, and in particular relates to a lighting effect control method, sound and ambient lighting device. Background Technology
[0002] Sound and light linkage lighting control has been widely used in scenarios such as audio ambient lighting, stage lighting, and vehicle ambient lighting. Users have increasingly higher requirements for the synchronization and real-time performance of lighting effects and audio rhythms. Especially in high-frequency rhythm scenarios such as electronic music and rock, the response speed of lighting effects directly determines the immersive experience.
[0003] The lighting control technology that follows the audio forcefully completes the current motion cycle before responding to a new audio frame. While this technology can ensure the integrity of a single motion, it suffers from severe response lag at high-frequency rhythms, failing to keep up with rhythmic changes and resulting in a disconnect between the lighting effects and the music. Alternatively, it may switch lighting effects immediately upon receiving a new audio frame, leading to abrupt changes, stuttering, flickering, and visual disturbances, resulting in poor smoothness and a poor user experience. Summary of the Invention
[0004] This application provides a method for controlling lighting effects, as well as a sound and ambient lighting device, which can solve the problem of poor lighting effects that change with audio.
[0005] In a first aspect, embodiments of this application provide a method for controlling lighting effects, including: Upon detecting the current rhythm point, based on the intensity value of the current rhythm point, the starting position of the LED bead in the LED strip, and the ending position of the LED bead in the LED strip, the expected cutoff position of the lighting effect corresponding to the current audio frame on the LED strip is determined. Here, the LED strip is an LED strip that changes its lighting effect in accordance with the audio, and the current rhythm point is a rhythm point in the current audio frame. The expected cutoff position is phase-converted to obtain the target motion phase of the light strip; Based on the deviation between the target motion phase and the current motion phase, it is determined whether the motion phase of the light strip needs to be reset, wherein the current motion phase is determined based on the previous audio frame of the current audio frame; If it is determined that the motion phase needs to be reset, the switching state of the LED beads on the LED strip is controlled so that the lighting effect of the LED strip moves towards the expected cutoff position.
[0006] In this application, after detecting the current rhythm point in the current audio, the expected cutoff position of the lighting effect is first determined based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip. Then, the expected cutoff position is phase-converted to obtain the target motion phase. If it is determined that a phase reset is needed based on the target motion phase and the current motion phase, the lighting effect movement is controlled according to the predicted cutoff position. After detecting the current rhythm point, this application checks whether the lighting effect needs to be adjusted and responds to the current rhythm point, instead of responding to the current rhythm point after forcibly completing the motion cycle of the currently executed lighting effect, as in the prior art. This application can eliminate the problem of response lag under high-frequency rhythms. In addition, this application also uses a hierarchical logic of expected cutoff position → target motion phase → phase deviation judgment to determine whether a phase reset is needed based on the phase deviation, avoiding jumps, flickering, and motion disorder caused by simple hard interruption. The start, stop, and turn of the lighting effect are natural and smooth, and the visual comfort is significantly improved.
[0007] In one possible implementation of the first aspect, determining the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip based on the intensity value of the current rhythm point, the starting position of the light strip's LED beads, and the ending position of the light strip's LED beads includes: Based on the position determination model, the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip is determined, wherein the position determination model is P_target=P s +(P e -P s )×S n P_target is the expected cutoff position, P s P represents the starting position of the LED bead in the LED strip. e S represents the position of the end LED bead of the LED strip. n The intensity value of the current rhythm point.
[0008] In this application, the cutoff position of the light effect is related to the intensity value of the current rhythm point. The greater the intensity value of the current rhythm point, the closer the cutoff position of the light effect is to the end position of the light strip; the smaller the intensity value of the current rhythm point, the closer the cutoff position of the light effect is to the beginning position of the light strip, so that the position of the light effect can follow the music and the position of the light effect can better reflect the dynamics of the music.
[0009] In one possible implementation of the first aspect, the step of performing a phase transformation on the expected cutoff position to obtain the target motion phase of the light strip includes: The expected cutoff position is phase-transformed using a position transformation model to obtain the target motion phase of the light strip, wherein the position transformation model is φ_target=(P_target-P s ) / (Pe -P s )×π, where φ_target is the target motion phase, P_target is the expected cutoff position, and P s P represents the starting position of the LED bead in the LED strip. e The position of the end LED bead of the LED strip.
[0010] In this application, since different light strips have different numbers of LEDs or different strip lengths, if the lighting effect is determined according to the specific physical position, then different light strips would need to use different position calculation models. This application normalizes the physical position of the lighting effect to the phase interval of [0, π], so that the same control algorithm can be adapted to light strips with different numbers of LEDs and different physical lengths, without having to redesign the logic for each type of light strip.
[0011] In one possible implementation of the first aspect, determining the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, upon detecting the current rhythm point, includes: If the current rhythm point is detected, the short-time energy of the current audio frame and the current spectral flux of the current audio frame are obtained; If the short-time energy of the current audio frame is greater than the short-time energy threshold and the current spectral flux of the current audio frame is greater than the spectral flux threshold, then the current rhythm point in the current audio frame is determined to be a valid rhythm point. Based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip is determined.
[0012] In this application, the validity of rhythm points is screened based on the short-time energy and current spectral flux of the current audio frame to ensure that the detected rhythm points are the real rhythm points in the audio frame, filter out environmental noise and smooth audio segments, and respond to the valid rhythm points if the current rhythm point is a valid rhythm point to avoid accidental light touch.
[0013] In one possible implementation of the first aspect, controlling the switching state of the LED beads on the light strip to move the light strip's illumination towards the intended cutoff position includes: Based on the intensity value of the current rhythm point and the basic movement speed of the lighting effect, the expected movement speed of the lighting effect is determined; The target speed of the light effect is obtained by weighted summing of the expected speed and the current speed of the light effect. Based on the intensity value of the current rhythm point, determine the target motion acceleration of the lighting effect; Based on the current cutoff position of the lighting effect, the target's movement speed, and the target's movement acceleration, determine the real-time cutoff position of the lighting effect; Based on the real-time cutoff position, the switching state of the LED beads on the LED strip is controlled, so that the lighting effect of the LED strip moves towards the expected cutoff position.
[0014] In this application, the expected movement speed of the light effect is first determined based on the intensity value of the current rhythm point and the basic movement speed of the light effect. Then, the expected movement speed and the current movement speed of the light effect are weighted and summed to obtain the target movement speed of the light effect. Finally, the movement of the light effect is controlled according to the target movement speed. Directly using the expected movement speed in this application would cause the movement speed of the light effect to change instantly, creating a visually jarring effect. By using weighted summation, the speed change is made gradual, which conforms to the inertia of physical motion and results in a softer visual effect.
[0015] In one possible implementation of the first aspect, upon detecting the current rhythm point, the method further includes: Obtain the tempo of the current audio frame and the emotional state of the current audio frame; Accordingly, determining the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip based on the intensity value of the current rhythm point, the starting position of the light strip's LED beads, and the ending position of the light strip's LED beads includes: If the beat speed is greater than a preset speed and the emotional state is in the first state, the expected cutoff position of the lighting effect corresponding to the current audio frame on the lighting strip is determined based on the intensity value of the current rhythm point, the starting position of the LED bead in the lighting strip, and the ending position of the LED bead in the lighting strip. In this application, when the beat speed is greater than a preset speed and the emotional state is in the first state, the interruption method of the current lighting effect is executed to interrupt the current lighting effect, and equivalent control is performed according to the current rhythm point. This application filters out scenarios that do not require immediate equivalent switching through conditional judgment, making the lighting effect changes more in line with the needs of the audio and improving the user's viewing experience.
[0016] In one possible implementation of the first aspect, after obtaining the tempo of the current audio frame and the emotional state of the current audio frame, the method further includes: If the beat speed is less than or equal to the preset speed and the emotional state is not the first state, obtain the time interval between historical rhythm points, wherein the historical rhythm point is the rhythm point before the current rhythm point; Based on the time interval, the lighting effect cycle of the current audio frame is determined; Based on the starting position of the LED beads in the light strip, the ending position of the LED beads in the light strip, and the light effect movement cycle, the switching state of the LED beads on the light strip is controlled so that the light effect of the light strip reciprocates between the starting position of the LED beads and the ending position of the LED beads until the light effect movement cycle ends.
[0017] In this application, the lighting effect model is distinguished by the beat speed and emotional state, so that the lighting effect does not depend on a single lighting effect and the lighting effect display is richer; in the scene where the lighting effect needs to be kept uninterrupted, the lighting effect completes a complete motion cycle, the lighting effect transition is smooth, and there is no flickering or sudden change caused by hard interruption.
[0018] In one possible implementation of the first aspect, after determining the lighting motion period of the current audio frame based on the time interval, the method further includes: If a new rhythm point is detected within the light effect movement cycle, the new rhythm point is ignored, wherein the new rhythm point is a rhythm point following the current rhythm point.
[0019] In this application, if a new rhythm point is detected within the equivalent motion cycle, the new rhythm point is ignored to ensure that the lighting effect triggered by the current audio frame can complete the entire motion cycle.
[0020] Secondly, embodiments of this application provide a lighting effect control device, including: The position determination module is used to determine the expected cutoff position of the light effect corresponding to the current audio frame on the light strip based on the intensity value of the current rhythm point, the starting position of the light strip, and the ending position of the light strip when the current rhythm point is detected. The light strip is a light strip that changes its light effect according to the audio, and the current rhythm point is a rhythm point in the current audio frame. A phase determination module is used to perform phase conversion on the expected cutoff position to obtain the target motion phase of the light strip; The phase reset judgment module is used to determine whether the motion phase of the light strip needs to be reset based on the deviation between the target motion phase and the current motion phase, wherein the current motion phase is determined based on the previous audio frame of the current audio frame; The lighting effect control module is used to control the switching state of the LED beads on the LED strip if it is determined that the motion phase needs to be reset, so that the lighting effect of the LED strip moves towards the expected cutoff position.
[0021] Thirdly, embodiments of this application provide an audio system, including: A light strip, wherein the light strip is provided with multiple LED beads; The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the lighting effect control method described in the first aspect above, so that the light strip is illuminated.
[0022] Fourthly, embodiments of this application provide an ambient lighting device, including: A light strip installed in the interior of a passenger vehicle, the light strip having multiple LED beads; The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the lighting effect control method described in the first aspect above, so that the light strip is illuminated.
[0023] Fifthly, embodiments of this application provide a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the lighting effect control method described in any one of the first aspects above.
[0024] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the lighting effect control method described in any one of the first aspects.
[0025] In a seventh aspect, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the lighting effect control method described in any of the first aspects above. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of a different structure of a sound source provided in one embodiment of this application; Figure 2 This is a flowchart illustrating a lighting effect control method provided in an embodiment of this application; Figure 3 This is a comparative schematic diagram of the lamp effect motion cutoff position provided in one embodiment of this application; Figure 4 This is a flowchart illustrating an embodiment of the effective rhythm point selection method provided in this application; Figure 5 This is a flowchart illustrating a method for smooth transition of lighting effects provided in an embodiment of this application; Figure 6 This is a flowchart illustrating a method for periodic response of lighting effects provided in an embodiment of this application; Figure 7 This is a schematic diagram of the periodic movement of a lighting effect provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a lighting effect control device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0028] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0029] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0030] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0031] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0032] To create a better user experience, current smart devices often incorporate ambient lighting. This can be found in various locations such as speakers, displays, car interiors, and light bars. These light bars can be cylindrical or circular.
[0033] Taking intelligent devices as an example, such as audio equipment Figure 1The images show speakers of different shapes. The hardware components of a speaker can include a signal receiving component, a data processing component, a sound reproduction component, and ambient lighting. The signal receiving component is the starting point for sound, used to acquire sound signals, which can be analog or digital signals, etc. The data processing component is used to filter and amplify the sound signal to obtain a processed sound signal. The sound reproduction component is used to convert the processed sound signal from an electrical signal into a sound wave. Additionally, the data processing component is used to determine the lighting mode of the ambient lighting to control its illumination.
[0034] The software architecture of an audio system can include an application layer, a service layer, a core processing layer, an algorithm and inference layer, and a system and driver layer.
[0035] The application layer is the interface through which users interact with the speaker, directly determining the product's functional experience. The application layer can include voice interaction, music playback, smart services, and system settings.
[0036] The service layer is the core that distinguishes smart speakers from traditional speakers, responsible for handling complex dialogue logic and providing personalized services. For example, the service layer can provide skill and service orchestration: routing user requests to the corresponding functional modules; the service layer can provide dialogue management: maintaining the context of the dialogue and resolving referential issues; the service layer can also provide user profiles: by analyzing user habits and preferences, it can provide personalized recommendations (such as recommending frequently listened-to music genres) and proactive services (such as automatically broadcasting morning traffic updates).
[0037] The core processing layer is responsible for processing all incoming and outgoing sound signals, ensuring that they are "clearly audible" and "well-playable".
[0038] The algorithm and inference layer is a collection of models that provide algorithmic support for upper-level processing, such as speech recognition models, natural language understanding models, and speech synthesis models.
[0039] The system and driver layers are responsible for interacting directly with the hardware and providing a unified calling interface for the upper layers.
[0040] During audio usage, after receiving a command signal, the application layer transmits it to the service layer. The service layer parses the command signal to determine the intent information. Based on this intent information, the service layer prepares resources and constructs a playback task, then transmits the playback task instruction to the core processing layer. The core processing layer retrieves the corresponding data based on the playback task instruction, decodes the data, and performs effect adaptation; it also calls the model in the algorithm and inference layer to adjust the audio. Finally, the core processing layer transmits the processed, correctly formatted audio data to the system and driver layer. The system and driver layer routes the audio data to the corresponding hardware device to achieve audio playback.
[0041] Currently, the lighting effects of intelligent devices generally follow audio changes, switching effects by monitoring rhythm points in audio frames. Common lighting control methods include: immediately stopping the current lighting effect upon detecting a new rhythm point and restarting control based on the new rhythm point, resulting in abrupt and stuttering effects; or, not immediately executing the lighting effect corresponding to the new rhythm point, but waiting for the current effect to complete its cycle before responding to the new rhythm point, causing lag and an inability to follow rhythm changes. Therefore, current lighting control methods all have drawbacks, resulting in poor lighting display and a poor user experience.
[0042] Based on this, in order to solve the problem of poor lighting effect display, this application proposes a lighting effect control method. First, based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, the expected cutoff position of the lighting effect is determined. Then, the expected cutoff position is phase-transformed to obtain the target motion phase. If it is determined that a phase reset is needed based on the target motion phase and the current motion phase, the lighting effect motion is controlled according to the predicted cutoff position. If it is determined that a phase reset is not needed based on the target motion phase and the current motion phase, the current lighting effect motion mode is maintained according to the current motion phase.
[0043] The following combination Figure 2 The lighting effect control method of this application embodiment will be described in detail. The method of this application can be run in a terminal device, wherein the terminal device can be a speaker, a display screen, a vehicle, a light stick, a television, a mechanical keyboard, a treadmill, a stage decoration equipment, etc.
[0044] Figure 2 A schematic flowchart of the lighting effect control method provided in this application is shown, with reference to... Figure 2 The method is described in detail below: S101, upon detecting a current rhythm point, based on the intensity value of the current rhythm point, the starting position of the LED bead in the LED strip, and the ending position of the LED bead in the LED strip, determine the expected cutoff position of the lighting effect corresponding to the current audio frame on the LED strip, wherein the LED strip is an LED strip whose lighting effect changes in accordance with the audio, and the current rhythm point is a rhythm point in the current audio frame.
[0045] In this embodiment, an audio signal is acquired and filtered to obtain a filtered audio signal. The filtered audio signal is then segmented into frames to obtain an audio frame sequence, where the frame length can be set as needed. The presence of rhythm points within the audio frames of the audio frame sequence is detected. The intensity value of the current rhythm point characterizes the energy strength or impact of the rhythm point, and the intensity value of the rhythm point can be identified using a neural network.
[0046] The starting LED position is the position of the first LED, for example, the starting LED position can be (0, 0); the ending LED position is the position of the last LED, for example, the ending LED position can be (100, 0).
[0047] The expected cutoff point is the end point of the light strip's lighting effect at the current rhythm point.
[0048] In this embodiment, based on a position determination model, the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip is determined, wherein the position determination model is P_target=P s +(P e -P s )×S n P_target is the expected cutoff position, P s P represents the starting position of the LED bead in the LED strip. e S represents the position of the end LED bead of the LED strip. n The intensity value of the current rhythm point.
[0049] For example, the position of the starting light can be (0, 0); the position of the ending light can be (100, 0); the intensity value of the current rhythm point is 0.75, then the expected cutoff position P_target = 0 + (100 - 0) × 0.75 = 75.
[0050] S102, perform phase conversion on the expected cutoff position to obtain the target motion phase of the light strip.
[0051] In this embodiment, since different light strips have different lengths and different numbers of LEDs, the physical position of the light effect between the start and end points is converted into an angle value (phase) between 0 and π. That is, the length of the light strip is represented by an angle value between 0 and π. It is not necessary to set a corresponding calculation model for each type of light strip; a unified calculation model can meet the calculation needs of different light strips. The phase is essentially the progress of the light in the motion cycle.
[0052] Specifically, the expected cutoff position is phase-transformed using a position transformation model to obtain the target motion phase of the light strip, wherein the position transformation model is φ_target=(P_target-P s ) / (P e -P s )×π, where φ_target is the target motion phase, P_target is the expected cutoff position, and P s P represents the starting position of the LED bead in the LED strip. e The position of the end LED bead of the LED strip.
[0053] For example, if the expected cutoff position is 75, the target motion phase φ_target = (75 - 0) / (100 - 0) × π = 0.75π.
[0054] S103, based on the deviation between the target motion phase and the current motion phase, determine whether the motion phase of the light strip needs to be reset, wherein the current motion phase is determined based on the previous audio frame of the current audio frame.
[0055] In this embodiment, the deviation between the target motion phase and the current motion phase is calculated. If the absolute value of the deviation is greater than or equal to the phase threshold, it indicates that the indicator position of the current rhythm point's lighting effect is far from the end position of the currently executing lighting effect. If a phase reset is not performed, the lighting effect will be severely lagging. In order to ensure the lighting effect display effect, it cannot continue to be executed according to the end position of the current lighting effect, and a phase switch, i.e., a phase reset, is required. Conversely, if the absolute value of the deviation is less than the phase threshold, it indicates that the indicator position of the current rhythm point's lighting effect is small from the end position of the currently executing lighting effect. Even if it continues to be executed according to the middle and end positions of the current lighting effect, it will not have a significant impact on the lighting effect display. If a forced reset is performed, it may cause unnecessary visual jitter. Therefore, a phase reset is not required, and the motion rhythm of the current lighting effect is maintained.
[0056] S104, if it is determined that the motion phase needs to be reset, control the switching state of the lamp beads on the light strip so that the light effect of the light strip moves towards the expected cutoff position.
[0057] In this embodiment, after determining that the light effect needs to move towards the expected cutoff position, the movement speed of the light effect is controlled according to the difference between the current position of the light effect and the expected cutoff position, so that the light effect can move smoothly towards the expected cutoff position.
[0058] For example, such as Figure 3 As shown, if the sound system is moving forward at the current cutoff position of the light effect, which is one-third of the way across the light strip, and if the expected cutoff position of the light effect is determined to be three-quarters of the way across the light strip based on the current rhythm point, the light effect will move forward from its current actual position to three-quarters of the way across the light strip.
[0059] In one possible implementation, due to the influence of environmental noise, the rhythm points in the detected audio frame may be environmental noise. In order to ensure that the detected rhythm points are the real rhythm points in the audio frame, environmental noise and smooth audio segments are filtered out, and only the real music rhythm (such as drum beats and downbeats) are responded to. To avoid false triggering of lights, the validity of the rhythm points needs to be detected, and the valid rhythm points are responded to.
[0060] Therefore, as Figure 4As shown, the implementation process of step S101 above also includes: S201, upon detecting the current rhythm point, acquire the short-time energy of the current audio frame and the current spectral flux of the current audio frame.
[0061] In this embodiment, the short-time energy and current spectral flux of the current audio frame are both calculated based on the spectral amplitude of the current audio frame. For each audio frame in the audio frame sequence, a short-time Fourier transform is performed on the audio frame to obtain its amplitude.
[0062] Specifically, the calculation method for short-time energy is as follows: E i =∑|x i , m |² / N (m=1,2,...,N), E i Let x be the short-time energy of the i-th audio frame, N be the total number of sampling points, and x be the short-time energy of the i-th audio frame. i , m Let be the spectral amplitude of the i-th audio frame at the m-th sampling point.
[0063] The method for calculating spectral flux is: SF i =∑|X i , k -X i-1 , k |²(k=1,2,...,M)SF i For spectral flux, X i , k X represents the spectral amplitude of the i-th audio frame at the k-th spectral point; M is the total number of spectral points, which can be half the number of Fourier transform points corresponding to the current audio frame, and is not restricted here; i-1 , k Let be the spectral amplitude of the (i-1)th audio frame at the kth spectral point.
[0064] S202, if the short-time energy of the current audio frame is greater than the short-time energy threshold and the current spectral flux of the current audio frame is greater than the spectral flux threshold, then the current rhythm point in the current audio frame is determined to be a valid rhythm point.
[0065] S203, based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, determine the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip.
[0066] In another implementation, if the short-time energy of the current audio frame is less than or equal to the short-time energy threshold, and / or the current spectral flux of the current audio frame is less than or equal to the spectral flux threshold, the current rhythm point in the current audio frame is determined to be an invalid rhythm point, and the current audio frame is discarded.
[0067] In this embodiment, the short-time energy threshold can be determined based on the average short-time energy of historical audio frames. The spectral flux threshold can be determined based on the average spectral flux of historical audio frames.
[0068] Specifically, the method for determining the short-time energy threshold is as follows: If the current audio frame is the j-th audio frame, obtain the average short-time energy of the audio frames from the jt-th audio frame to the (j-1)-th audio frame to obtain the average short-time energy, where t is a positive integer greater than or equal to 1. Calculate the product of the first correction coefficient and the average short-time energy to obtain the short-time energy threshold, where j is a positive integer greater than 1. If j=1, the average short-time energy is 0.
[0069] For example, obtain the short-time energy of the three audio frames preceding the current audio frame, calculate the average of the three short-time energies, and obtain the short-time energy mean. If the first correction factor is 2, multiply the short-time energy mean by 2 to obtain the short-time energy threshold.
[0070] The method for determining the spectral flux threshold is as follows: If the current audio frame is the j-th audio frame, obtain the average short-time energy of the jr-th audio frame to the (j-1)-th audio frame to obtain the average short-time energy, where r is a positive integer greater than or equal to 1. Calculate the product of the second correction coefficient and the average short-time energy to obtain the short-time energy threshold.
[0071] For example, obtain the spectral flux of the three audio frames preceding the current audio frame, calculate the average of the three spectral fluxes, and obtain the spectral flux mean. If the second correction factor is 1.6, multiply the spectral flux mean by 1.6 to obtain the spectral flux threshold.
[0072] After determining that the current rhythm point is a valid rhythm point, the trigger time of the current rhythm point can be corrected to obtain the accurate trigger time. Specifically, the clock deviation compensation value is obtained, and the clock deviation compensation value is added to the acquisition time of the current audio frame to obtain the accurate trigger time of the current rhythm point. The trigger time is the specific time when the lighting effect starts to adjust.
[0073] In one possible implementation, to ensure the smoothness of the lighting effect during operation, the real-time position of the lighting effect can be determined by using both the running speed and acceleration of the lighting effect.
[0074] Specifically, such as Figure 5 As shown, the implementation process of step S104 above may include: S1041, Based on the intensity value of the current rhythm point and the basic movement speed of the light effect, determine the expected movement speed of the light effect.
[0075] In this embodiment, before calculating the expected movement speed, the expected movement direction of the light effect needs to be determined. Specifically, the current rhythm point interval is calculated, which is the time interval between the current rhythm point and the previous valid rhythm point. The current rhythm point interval T_interval = 1 / BPM × 60, where BPM is the audio rhythm speed. For example, T_interval = 1 / 180 × 60 ≈ 0.333s. If the current rhythm point interval is less than half of the base period (for example, half of the base period can be 0.5s, etc.), it means that the music rhythm is fast, and the light effect should immediately move in the opposite direction to avoid falling behind the rhythm or delaying the response. Therefore, if the current movement direction of the light effect is the outward direction, the expected movement direction is determined to be the return movement (i.e., moving from the end light bead position to the starting light bead position); if the current movement direction of the light effect is the return direction, the expected movement direction is determined to be the outward direction. If the current rhythm interval is greater than or equal to half of the basic cycle, it means that the music rhythm is slow. The light effect can continue to maintain the current direction of movement and maintain the natural continuity of the movement. Therefore, if the current direction is outward, the expected direction of movement is determined to be the outward direction (i.e., moving from the starting light bead position to the ending light bead position); if the current direction is return, the expected direction of movement is determined to be the return direction.
[0076] In this embodiment, V_new = Dir_new × v_base × (1 + S) n )×k, where V_new is the expected motion speed, Dir_new is the expected motion direction, v_base is the preset base motion speed, and S n is the intensity value of the current rhythm point, and k is the preset direction correction coefficient.
[0077] S1042, the expected movement speed and the current movement speed of the light effect are weighted and summed to obtain the target movement speed of the light effect.
[0078] In this embodiment, the target motion speed V_target = ω·V_new + (1-ω)·V_current, where V_target is the target motion speed, V_new is the expected motion speed, V_current is the current motion speed, and ω is the preset vector superposition weight.
[0079] S1043, Based on the intensity value of the current rhythm point, determine the target motion acceleration of the lighting effect.
[0080] In this embodiment, the formula a_target = a_base × (1 + 0.5 × S) is used. n )×Dir_new calculates the target's acceleration, where a_target is the target's acceleration, a_base is the preset base acceleration, and S nDir_new represents the intensity value of the current rhythm point, and Dir_new represents the expected direction of motion.
[0081] S1044, Based on the current cutoff position of the lighting effect, the target's movement speed, and the target's movement acceleration, determine the real-time cutoff position of the lighting effect.
[0082] In this embodiment, the real-time cutoff position is calculated based on a position calculation model. The position calculation model is: P(t) = P_current + V_target × t + 0.5 × a_target × t², where P(t) is the real-time cutoff position, P_current is the current cutoff position, V_target is the target velocity, a_target is the target acceleration, and t is time.
[0083] S1045, based on the real-time cutoff position, control the switching state of the LED beads on the LED strip, so that the lighting effect of the LED strip moves towards the expected cutoff position.
[0084] In one possible implementation, if phase reset is required, phase smoothing is needed to ensure time continuity when transitioning from the current motion phase to the target motion phase. Specifically, the real-time phase calculation model is: φ(t) = φ_current + (φ_target - φ_current) × (1 - e^(-t / t)) (-t / T) ), where φ(t) is the real-time phase, that is, the phase value at time t; φ_current is the phase corresponding to the current cutoff position of the lighting effect; φ_target is the target motion phase; t is the phase transition time; and T is the phase transition duration.
[0085] In one possible implementation, when controlling the movement of the lighting effects, it is also possible to determine whether to perform a phase reset and recalculate the target movement speed based on the intensity value of the current rhythm point.
[0086] Specifically, the above methods may also include the following:
[0087] If the intensity value of the current rhythm point is less than the first threshold (e.g., 0.3), the above steps S101 to S103 are not executed, and the above steps S1041 to S1045 are executed instead. That is, the phase reset is not executed, and the target motion speed is recalculated.
[0088] If the intensity value of the current rhythm point is greater than or equal to the first threshold and less than the second threshold (e.g., 0.8), execute steps S101 to S104 and steps S1041 to S1045, which means performing phase reset and recalculating the target motion speed. The phase transition duration is the first duration.
[0089] If the intensity value of the current rhythm point is greater than or equal to the second threshold, execute steps S101 to S104 and steps S1041 to S1045, which involves resetting the phase and recalculating the target motion speed. The phase transition duration is the second duration. The second duration is shorter than the first duration, resulting in a faster light effect motion speed.
[0090] In one possible implementation, to diversify the lighting effects, multiple lighting effect models can be set up for automatic switching. Specifically, when the current rhythm point is detected, the above method also includes: Get the tempo and emotional state of the current audio frame.
[0091] In this embodiment, the emotional state of the current audio can be determined by an emotional classification model. The emotional state can include calm, excited, sad, and joyful states, etc.
[0092] In this embodiment, the interval time of multiple effective rhythm points is obtained, and the average of the multiple interval times is calculated to obtain the average interval T_avg. Multiple audio frames are input into the beat speed detection model to obtain the predicted beat speed. The beat speed correction value ΔBPM = (1 / T_avg - 1 / T) p e )×60, T_avg is the average interval, T p e =60 / BPM p e BPM p e To predict the beat tempo, the predicted beat tempo is added to a beat tempo correction value to obtain the final beat tempo of the current audio.
[0093] In one approach, if the beat speed is greater than a preset speed and the emotional state is in the first state, a phase reset mode is executed, causing the lighting effects to change immediately following the current audio frame.
[0094] Specifically, the phase reset mode is as follows: based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, determine the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip, and continue to execute the above steps S102 to S104.
[0095] In this embodiment, the first state may include an excited state and a joyful state, etc., and is not limited here. The preset speed can be set as needed, for example, the preset speed can be 100 or 110, etc., and is not limited here.
[0096] In another implementation, if the beat speed is less than or equal to the preset speed and the emotional state is not the first state, then the above steps S101 to S104 are not executed, and the lighting effect cycle response mode is executed instead.
[0097] Specifically, such as Figure 6 As shown, the implementation process of the lighting effect periodic response mode includes: S301, obtain the time interval between historical rhythm points, wherein the historical rhythm points are the rhythm points before the current rhythm point.
[0098] In this embodiment, the time interval between historical rhythm points is at least one. For example, the time interval between the first and second rhythm points is 0.5 seconds, and the time interval between the second and third rhythm points is 0.48 seconds, etc. Historical rhythm points include rhythm points preceding and adjacent to the current rhythm point.
[0099] S302, Based on the time interval, determine the lighting effect motion cycle of the current audio frame.
[0100] In this embodiment, if multiple time intervals exist, the average of the time intervals is calculated to obtain the time average. The time average is then used to determine the lighting effect cycle.
[0101] Specifically, the cycle duration is calculated using the formula: T_cycle = ΔT × γ + T_base × (1 - γ), where T_cycle is the cycle duration, ΔT is the average time, γ is the preset fusion coefficient, and T_base is the preset base cycle. The cycle end time is obtained by adding the cycle duration to the current rhythm point; the current rhythm point is taken as the cycle start time; the light effect movement cycle from the cycle start time to the cycle end time is denoted as [T]. n T n +T_cycle]. The current rhythm point represents the specific time when the light effect movement is triggered at the current rhythm point, T n This is the current rhythm point.
[0102] S303, based on the starting position of the LED bead in the light strip, the ending position of the LED bead in the light strip, and the light effect movement cycle, control the switching state of the LED beads on the light strip so that the light effect of the light strip reciprocates between the starting position of the LED bead and the ending position of the LED bead until the light effect movement cycle ends.
[0103] In this embodiment, within the equivalent motion cycle, the lighting effect can move from the starting lamp position to the ending lamp position, and then move from the ending lamp position back to the starting lamp position, completing a complete lighting effect cycle.
[0104] In this embodiment, the real-time lighting effect position is calculated. Since the lighting effect movement includes a going-away and a returning journey, the lighting effect on the going-away journey is located at T. n ≤t <T n Movement between +T_cycle / 2, T n The current rhythm point is represented by T_cycle, which is the duration of the cycle; the return lighting effect occurs at T_cycle. n +T_cycle / 2≤t <T n + Movement between T_cycles.
[0105] The real-time lighting position for the outbound journey is: P(t) = P s +[(P e -P s ) / T_half]×(t-T n )+a1×(t-T n )², P(t) is the real-time lighting position of the outgoing route, P s P represents the starting position of the LED strip. e The position of the end LED bead in the LED strip is T_half = T_cycle / 2, where T is the end LED bead position. n At the current rhythm point, a1 is the preset acceleration of the light effect's outward journey.
[0106] The real-time lighting position for the return trip is: P(t)s=P e -[(P e -P s ) / T_half]×(t-T n -T_half)+a2×(t-T n -T_half)², P(t)s is the real-time position of the return light effect, and a2 is the preset return acceleration of the light effect.
[0107] In this embodiment, the lighting effect can move from the starting position of the LED bead to the ending position of the LED bead to complete a full lighting effect cycle. The real-time position of the lighting effect is: P(t)h = P s +[(P e -P s ) / T_cycle]×(t-T n )+a×(t-T n )², P(t)h is the real-time position of the lighting effect, and a is the preset acceleration.
[0108] S304, if a new rhythm point is detected within the light effect movement cycle, the new rhythm point is ignored, wherein the new rhythm point is a rhythm point after the current rhythm point.
[0109] For example, such as Figure 7 As shown, if the current light effect is in motion, the preset light effect motion cycle is a reciprocating motion, that is, from the starting point to the ending point and then from the ending point to the starting point as one cycle; if a new rhythm point is received when the light effect is at position A of the light strip, the rhythm point is ignored and the light effect continues to move until one cycle of motion is completed.
[0110] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0111] Corresponding to the lighting effect control method described in the above embodiments, Figure 8 A structural block diagram of the lighting effect control device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0112] Reference Figure 8 The device 400 may include: a position determination module 410, a phase determination module 420, a phase reset judgment module 430, and a lighting effect control module 440.
[0113] The position determination module 410 is used to determine the expected cutoff position of the light effect corresponding to the current audio frame on the light strip based on the intensity value of the current rhythm point, the starting position of the light strip and the ending position of the light strip when the current rhythm point is detected. The light strip is a light strip that changes its light effect according to the audio, and the current rhythm point is a rhythm point in the current audio frame. Phase determination module 420 is used to perform phase conversion on the expected cutoff position to obtain the target motion phase of the light strip; The phase reset judgment module 430 is used to determine whether the motion phase of the light strip needs to be reset based on the deviation between the target motion phase and the current motion phase, wherein the current motion phase is determined based on the previous audio frame of the current audio frame; The lighting effect control module 440 is used to control the switching state of the LED beads on the LED strip if it is determined that the motion phase needs to be reset, so that the lighting effect of the LED strip moves towards the expected cutoff position.
[0114] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Furthermore, the specific names of each functional unit and module are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0115] This application embodiment also provides an audio system, including: a light strip with a plurality of LED beads; a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned lighting effect control method so that the light strip is lit.
[0116] This application embodiment also provides an ambient lighting device, including: a light strip mounted on the interior of a passenger vehicle, the light strip having a plurality of LED beads; a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned lighting effect control method so that the light strip is illuminated.
[0117] This application also provides a terminal device, see [link to relevant documentation] Figure 9 The terminal device 500 may include: at least one processor 510, a memory 520, and a computer program stored in the memory 520 and executable on the at least one processor 510. When the processor 510 executes the computer program, it implements the steps in any of the above method embodiments, for example... Figure 2 Steps S101 to S104 in the illustrated embodiment. Alternatively, when the processor 510 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 8 The functions of the position determination module 410 to the lighting effect control module 440 are shown.
[0118] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 520 and executed by processor 510 to complete this application. The one or more modules / units may be a series of computer program segments capable of performing specific functions, which describe the execution process of the computer program in terminal device 500.
[0119] Those skilled in the art will understand that Figure 9This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.
[0120] The processor 510 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0121] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0122] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by one or more processors, it can implement the steps of the various method embodiments described above.
[0123] Similarly, as a computer program product, when the computer program product is run on a terminal device, it enables the terminal device to implement the steps in the above-described method embodiments.
[0124] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0125] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for controlling lighting effects, characterized in that, include: Upon detecting the current rhythm point, the beat speed of the current audio frame and the emotional state of the current audio frame are obtained; If the beat speed is greater than a preset speed and the emotional state is in the first state, based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, the expected cutoff position of the light effect corresponding to the current audio frame on the light strip is determined; wherein, the light strip is a light strip whose light effect changes with the audio, the current rhythm point is a rhythm point in the current audio frame; the expected cutoff position is the end position of the light effect of the light strip at the current rhythm point; the expected cutoff position is phase-converted to obtain the target motion phase of the light strip; Based on the deviation between the target motion phase and the current motion phase, if the absolute value of the deviation is greater than or equal to the phase threshold, it is determined that the motion phase of the light strip needs to be reset; if the absolute value of the deviation is less than the phase threshold, it is determined that the motion phase of the light strip does not need to be reset; wherein, the current motion phase is determined based on the previous audio frame of the current audio frame. If it is determined that the motion phase needs to be reset, the switching state of the LED beads on the LED strip is controlled according to the difference between the current position and the expected cutoff position of the LED strip effect, so that the LED strip effect moves towards the expected cutoff position. If the beat speed is less than or equal to the preset speed and the emotional state is not the first state, obtain the time interval between historical rhythm points, wherein the historical rhythm point is the rhythm point before the current rhythm point; Based on the time interval, the lighting effect cycle of the current audio frame is determined; Based on the starting position of the LED beads in the light strip, the ending position of the LED beads in the light strip, and the light effect movement cycle, the switching state of the LED beads on the light strip is controlled so that the light effect of the light strip reciprocates between the starting position of the LED beads and the ending position of the LED beads until the light effect movement cycle ends.
2. The lighting effect control method as described in claim 1, characterized in that, The step of determining the expected cutoff position of the lighting effect corresponding to the current audio frame on the lighting strip based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip includes: Based on the position determination model, the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip is determined, wherein the position determination model is P_target=P s +(P e -P s )×S n P_target is the expected cutoff position, P s P represents the starting position of the LED bead in the LED strip. e S represents the position of the end LED bead of the LED strip. n The intensity value of the current rhythm point.
3. The lighting effect control method as described in claim 2, characterized in that, The step of performing phase transformation on the expected cutoff position to obtain the target motion phase of the light strip includes: The expected cutoff position is phase-transformed using a position transformation model to obtain the target motion phase of the light strip, wherein the position transformation model is φ_target=(P_target-P s ) / (P e -P s )×π, where φ_target is the target motion phase, P_target is the expected cutoff position, and P s P represents the starting position of the LED bead in the LED strip. e The position of the end LED bead of the LED strip.
4. The lighting effect control method as described in claim 1, characterized in that, Upon detecting a current rhythm point, the step of determining the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip includes: If the current rhythm point is detected, the short-time energy of the current audio frame and the current spectral flux of the current audio frame are obtained; If the short-time energy of the current audio frame is greater than the short-time energy threshold and the current spectral flux of the current audio frame is greater than the spectral flux threshold, then the current rhythm point in the current audio frame is determined to be a valid rhythm point. Based on the intensity value of the current rhythm point, the starting position of the LED bead in the light strip, and the ending position of the LED bead in the light strip, the expected cutoff position of the lighting effect corresponding to the current audio frame on the light strip is determined.
5. The method for controlling lighting effects as described in any one of claims 1 to 4, characterized in that, Controlling the switching state of the LED beads on the light strip to move the light strip's illumination towards the expected cutoff position includes: Based on the intensity value of the current rhythm point and the basic movement speed of the lighting effect, the expected movement speed of the lighting effect is determined; The target speed of the light effect is obtained by weighted summing of the expected speed and the current speed of the light effect. Based on the intensity value of the current rhythm point, determine the target motion acceleration of the lighting effect; Based on the current cutoff position of the lighting effect, the target's movement speed, and the target's movement acceleration, determine the real-time cutoff position of the lighting effect; Based on the real-time cutoff position, the switching state of the LED beads on the LED strip is controlled, so that the lighting effect of the LED strip moves towards the expected cutoff position.
6. The lighting effect control method as described in claim 1, characterized in that, After determining the lighting motion cycle of the current audio frame based on the time interval, the method further includes: If a new rhythm point is detected within the light effect movement cycle, the new rhythm point is ignored, wherein the new rhythm point is a rhythm point following the current rhythm point.
7. A sound system, characterized in that, include: A light strip, wherein the light strip is provided with multiple LED beads; The light strip is provided with a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the lighting effect control method as described in any one of claims 1 to 6, so that the light strip is illuminated.
8. An ambient lighting device, characterized in that, The ambient lighting device includes: A light strip installed in the interior of a passenger vehicle, the light strip having multiple LED beads; The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the lighting effect control method as described in any one of claims 1 to 6, so that the light strip is illuminated.
Citation Information
Patent Citations
CN121126641A