A light source machine music mode light effect triggering control method and system

CN122803131APending Publication Date: 2026-09-22SHENZHEN LANFANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611232146.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

[0003]然而,现有方案直接根据ADC采样值与预设阈值的比较结果触发灯效,容易受到环境噪声、瞬时尖峰信号或连续高电平信号的影响

Benefits of technology

本申请通过对灵敏度数据进行映射处理确定当前触发阈值,并在音频采样值超过当前触发阈值时,进一步要求当前处于允许触发状态、冷却状态结束且距上一次有效音乐触发的时间间隔满足可见触发间隔,才生成一次有效音乐触发信号,触发后关闭触发许可直至采样值回落至当前触发阈值减去预设滞回量以下才重新允许触发,从而使声音信号必须形成一次完整的上升和回落过程后才允许再次触发灯效,减少了环境噪声、瞬时尖峰和连续高电平造成的误触发,避免了灯效在短时间内连续乱闪,在不改变基本音频采样硬件的情况下提高了音乐模式灯效触发的稳定性,使灯效既能响应声音变化,又能减少无效触发和视觉混乱,整体显示效果更加自然。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122803131A_ABST
    Figure CN122803131A_ABST
Patent Text Reader

Abstract

This application relates to the field of intelligent control technology, and provides a method and system for triggering music mode lighting effects in a light source. The method obtains audio sample values ​​by sampling audio data at a preset period, and maps the sensitivity data to determine the current trigger threshold. When the audio sample value exceeds the current trigger threshold and is in a trigger-allowed state, cooling is complete, and the visible trigger interval from the last trigger is met, a valid music trigger signal is generated and the lighting effect is updated. After triggering, the trigger permission is disabled until the sample value falls below the threshold minus the hysteresis, at which point triggering is re-allowed. This solves the problem in existing technologies where directly comparing sample values ​​with the threshold causes repeated triggering due to fluctuations near the threshold, resulting in frequent and erratic lighting effects. It improves the stability of music lighting effect triggering without changing the audio sampling hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent control technology, and in particular to a method and system for triggering and controlling the lighting effect of a light source in a music mode. Background Technology

[0002] Existing light source lighting mechanisms typically acquire sound signals through microphones, line-in audio input circuits, or audio detection circuits. The ADC (Analog-to-Digital Converter) module of the MCU (Microcontroller Unit) then periodically obtains audio sample values. The control program compares the ADC sample values ​​with preset thresholds. When the sample value reaches the trigger condition, it controls the RGBW LEDs to perform music-themed lighting effects such as jumping, breathing, flashing, and fading.

[0003] However, existing solutions directly trigger lighting effects based on the comparison between ADC sample values ​​and preset thresholds, which is easily affected by environmental noise, instantaneous spike signals, or continuous high-level signals. When the sound signal fluctuates around the threshold, the program will repeatedly trigger the lighting effects, causing the effects to jump frequently and flash continuously, resulting in unstable display effects. Summary of the Invention

[0004] The purpose of this application is to provide a method and system for triggering and controlling the lighting effects of a music mode in a light source, so as to improve the above-mentioned problems in the prior art.

[0005] For the purposes mentioned above, this application provides the following technical solution: The first aspect of this application provides a method for triggering and controlling the lighting effect of a music mode using a light source, including: Audio data is sampled at a preset period to obtain audio sample values; Acquire sensitivity data, perform mapping processing on the sensitivity data, and determine the current trigger threshold based on the mapped sensitivity data. The mapped sensitivity data and the current trigger threshold have a first correspondence relationship. The larger the mapped sensitivity data, the lower the current trigger threshold. The smaller the mapped sensitivity data, the higher the current trigger threshold. When the audio sample value exceeds the current trigger threshold, and the current state is in the allowed trigger state, the cooling state has ended, and the time interval since the last valid music trigger meets the preset visible trigger interval, a valid music trigger signal is generated, and the lighting effect is updated according to the current music sub-mode; wherein, after the valid music trigger signal is generated, the trigger permission is closed until the audio sample value falls back to below the current trigger threshold minus the preset hysteresis amount, and then the allowed trigger state is re-entered.

[0006] Further, the sensitivity data is mapped, including: The sensitivity data is normalized to a first value; Select the corresponding curve gain according to the current music sub-mode and determine the non-linear mapping relationship, and map the first value to the second value based on the non-linear mapping relationship; After the second value is converted and scaled according to a preset method, the sensitivity data after mapping is obtained.

[0007] Furthermore, the method for determining the visible trigger interval includes: The visible trigger interval is determined based on the current music sub-mode, which includes a jump sub-mode, a breathing sub-mode, a strobe sub-mode, and a fade sub-mode. When the current music sub-mode is the jump sub-mode or the strobe sub-mode, the visible trigger interval is the first time interval; When the current music sub-mode is the breathing sub-mode or the gradient sub-mode, the visible trigger interval is the second time interval, and the first time interval is greater than the second time interval.

[0008] Preferably, after generating the effective music trigger signal, the system enters the cooling state and activates a micro-pulse enhancement effect of a preset duration. No new effective music trigger signal can be generated before the cooling state ends. The micro-pulse enhancement effect is used to enhance the brightness of the LED beads corresponding to the lighting effect.

[0009] Furthermore, updating the lighting effects according to the current music sub-mode includes: Obtain the time difference between the generation time of the valid music trigger signal and the generation time of the previous valid music trigger signal; When the time difference is within a preset valid range, the time difference is determined as a valid beat period. The valid beat period is used to determine the light change speed corresponding to the light effect, and the valid beat period corresponding to the subsequently generated valid music trigger signal is updated according to a smooth calculation method.

[0010] Furthermore, the step of updating the lighting effects according to the current music sub-mode also includes: If the audio sample value exceeds the current trigger threshold, the trigger strength is determined based on the difference between the audio sample value and the current trigger threshold; The light brightness corresponding to the light effect is determined based on the trigger intensity. The greater the trigger intensity, the higher the light brightness corresponding to the light effect.

[0011] Furthermore, the step of updating the lighting effects according to the current music sub-mode also includes: After generating the valid music trigger signal, the valid color is determined according to the current color wheel state, which includes a color slot array, a current color index, and a number of valid colors. The valid color is determined according to the position of the current color index in the color slot array. Based on the audio sample value, the trigger intensity, the effective beat period, and the brightness coefficient calculation rule corresponding to the current music sub-mode, the brightness coefficient of the current music sub-mode is obtained. The RGB values ​​of the lighting effect output are determined based on the effective color and brightness coefficient, and the RGB values ​​are limited to a preset range.

[0012] Furthermore, obtaining the audio sample values ​​includes: The valid value of the sampled audio data is determined by judging the validity of the sampled values, and the audio sampled value is determined based on the judgment result. The valid value judgment includes the judgment of the legal range, the limiting of outlier values, and the elimination of silence noise.

[0013] A second aspect of this application provides a light source machine music mode lighting effect triggering control system, the system being used to implement the light source machine music mode lighting effect triggering control method described in the first aspect of this application, the system comprising: The audio sampling module is used to sample audio data at preset intervals to obtain audio sample values; The threshold determination module is used to acquire sensitivity data, perform mapping processing on the sensitivity data, and determine the current trigger threshold based on the mapped sensitivity data. The trigger determination module is used to generate a valid music trigger signal when the audio sample value exceeds the current trigger threshold, and the current state is in the allowed trigger state, the cooling state has ended, and the time interval since the last valid music trigger meets the preset visible trigger interval; wherein, after generating the valid music trigger signal, the trigger permission is closed until the audio sample value falls back to below the current trigger threshold minus the preset hysteresis amount, and then the allowed trigger state is re-entered; The lighting effect update module is used to update the lighting effect according to the current music sub-mode after the valid music trigger signal is generated.

[0014] A third aspect of this application provides an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is used for the instructions to implement a light source music mode lighting effect triggering control method as described in the first aspect of this application.

[0015] The fourth aspect of this application provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the light source music mode lighting effect triggering control method described in the first aspect of this application.

[0016] The fifth aspect of this application provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of a light source machine music mode lighting effect triggering control method as described in the first aspect of this application.

[0017] The light source music mode lighting effect triggering control method provided in this application can achieve at least the following technical effects: This application determines the current trigger threshold by mapping sensitivity data. When the audio sample value exceeds the current trigger threshold, it further requires that the current state be in a trigger-allowed state, the cooling state be over, and the time interval from the last valid music trigger meet the visible trigger interval before a valid music trigger signal is generated. After triggering, the trigger permission is closed until the sample value falls back to below the current trigger threshold minus the preset hysteresis before triggering is allowed again. This ensures that the sound signal must complete a complete rise and fall process before the light effect can be triggered again, reducing false triggers caused by environmental noise, instantaneous spikes, and continuous high levels. It also avoids the light effect from flashing continuously in a short period of time, improving the stability of music mode light effect triggering without changing the basic audio sampling hardware. This allows the light effect to respond to sound changes while reducing invalid triggers and visual clutter, resulting in a more natural overall display effect. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 A schematic diagram illustrating the steps of a method for triggering and controlling the lighting effect in a music mode using a light source, as provided in this application embodiment; Figure 2 This is a schematic diagram of the overall process of a light source machine music mode lighting effect triggering control method provided in an embodiment of this application; Figure 3 A schematic diagram of a light source machine music mode lighting effect triggering control system provided in this application embodiment; Figure 4 A schematic diagram of a computer device provided for an embodiment of this application; Reference numerals: 300, a light source music mode lighting effect triggering control system; 301, audio sampling module; 302, threshold determination module; 303, trigger judgment module; 304, lighting effect update module; 401, memory; 402, processor. Detailed Implementation The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] This application uses multiple conditions to jointly determine the audio sample values, ensuring that a valid music trigger signal is generated only after the sound signal completes a full rise and fall process. It also updates the lighting effects differently based on the current music sub-mode, thereby reducing false triggers and random flashing of lighting effects without changing the audio sampling hardware. Figure 1 and Figure 2 As shown, the method for triggering and controlling the lighting effect of a music mode using a light source provided in this embodiment specifically includes the following steps: Step S100: Sample the audio data according to a preset period to obtain audio sample values.

[0021] Specifically, upon entering music mode, the system reads the ADC sampling results of the audio data at a set period as audio sample values, which are digital quantities. This reading can be performed by the audio sampling module through timed sampling, interrupt sampling, or DMA (Direct Memory Access) caching. After sampling, the digital audio sample value sampled by the ADC is written to the audio data cache. During music mode operation, the cached audio sample value is read directly. The range of audio sample values ​​is related to the ADC resolution; for example, when the ADC resolution is 12 bits, the corresponding audio sample value is 0~4095. In this embodiment, the audio signal can be acquired by a microphone, a line audio input circuit, or an audio detection circuit.

[0022] Further, in step S100, obtaining the audio sample value also includes determining the valid value of the ADC sampling result of the audio data, and determining the audio sample value used for subsequent calculations based on the determination result. In a preferred embodiment, the valid value determination includes sampling batch integrity determination, amplitude limiting processing, and noise removal. Specifically, the sampling batch integrity determination includes: when a non-zero value has been written to the 10th sampling position of the DMA cache, it is determined that the acquisition of a batch of 10 sampling points has been completed. The amplitude limiting processing includes: performing a first-order low-pass filter on the 12-bit resolution ADC sampling result, with the filtering relationship being... ,in, The current audio sample value of the ADC. This is the current filter output value. The output value of the previous filter is used; the initial filter value is taken as the static bias value of the ADC, 1000; and the result of each filter is... The value is limited to the range of 0 to 4095. Finally, the noise reduction includes: comparing the filtered value after the limiting process with the current trigger threshold determined in step S200. A comparison is made, and when the filtered value falls into the current trigger threshold... When a valid music trigger is detected, the corresponding ADC sample value is determined as the audio sample value for subsequent calculations; otherwise, it is determined to be silence or noise interference and is not used for subsequent calculations. This embodiment achieves the elimination of silence noise through the combined effect of the first-order low-pass filter and the trigger threshold. For example, the current trigger threshold... The preferred value range is 1750~1850. Under this setting, if the previous filter value is stable at about 1000, an isolated spike with an original value of about 2000 will appear. After the first-order low-pass filter, the output value is about 1100. This value is still lower than the lower limit of the trigger threshold range of 1750, so no effective music trigger will be generated, thus eliminating the false triggering of silence noise.

[0023] Optionally, the sampled value used for the above effective value judgment can be the digital quantity of the ADC sampling result, or the peak value or average peak value in multiple consecutive ADC samplings.

[0024] Optionally, the music mode includes four sub-modes: jump sub-mode, breathing sub-mode, strobe sub-mode, and fade sub-mode.

[0025] Step S200: Obtain sensitivity data The sensitivity data is mapped, and the mapped sensitivity data is used as the basis for the mapping process. Determine the current trigger threshold .

[0026] Specifically, it first reads the music sensitivity data sent by an external control device such as an APP or serial port. Preferably, sensitivity data The range is 1 to 100; where, if the sensitivity data If the value is less than 1, then take the value 1; if the sensitivity data If the value is greater than 100, then use 100. Optionally, if the external protocol of the APP or external control device such as a serial port uses a range of 1 to 64 bits, then the obtained sensitivity data will be... Convert proportionally to a range of 1 to 100. For example, sensitivity data are converted according to the following formula (1). Perform the conversion: (1) In formula (1), Raw sensitivity data sent by external control devices such as APP or serial port; This is used to calculate the current trigger threshold after conversion. Sensitivity data. Finalized sensitivity data. The higher the threshold, the higher the current trigger threshold calculated subsequently. The lower the sensitivity, the easier it is to be triggered by audio; sensitivity data The lower the threshold, the lower the current trigger threshold. The higher the value, the stronger the anti-interference ability.

[0027] Further, in step S200, the sensitivity data... Mapping processing includes: Step S201: Transfer the sensitivity data Normalized to the first value ; Step S202: Select the corresponding curve gain according to the current music sub-mode and determine the nonlinear mapping relationship. Based on the nonlinear mapping relationship, adjust the first value... Mapped to a second value ; Step S203: For the second value After conversion and scaling according to a preset method, the mapped sensitivity data is obtained. .

[0028] Specifically, the obtained sensitivity data is first processed according to the following formula (2). , The range is 0~1; then select the corresponding curve gain according to the current music sub-mode. And determine the nonlinear mapping relationship, and based on the nonlinear mapping relationship, the first value is... Mapped to a second value By mapping, the changes in sensitivity data at low levels are made more gradual, while the changes in sensitivity data at medium to high levels are more pronounced. Then, the second value... Perform conversion and scaling: First, convert the following formula (3) to... Converted to The value is limited to 1~100, and then scaled by 99% based on 1, as shown in equation (4) below, to finally obtain the sensitivity data used for triggering judgment. .

[0029] (2) (3) (4) Preferably, in this embodiment, the Schlick gain curve is used to normalize the first value. Dynamic adjustments are made. First, the bias function Bias is defined as follows (5): (5) in, For the current independent variable, The preset bias parameters are used. Based on the above bias function, intermediate mapping variables are set. That is, the second value. When the first value At that time, the second value is calculated based on the following formula (6). When the first value The second value is then calculated based on the following formula (7). .

[0030] (6) (7) In the above formula, Curve gain controls the steepness of the mapping curve. Based on the visual characteristics of the music sub-modes, the gain was selected as follows: 0.65 for the jump sub-mode, 0.58 for the breathing sub-mode, 0.68 for the strobe sub-mode, and 0.58 for the fade sub-mode. Among these, the jump and strobe sub-modes have more direct responses, therefore the gain... The gain can be slightly higher; the breathing sub-mode and the gradual sub-mode have a transition process, therefore the gain... The selection can be slightly reduced.

[0031] Preferably, the normalized second value is obtained based on the above equation (6) or (7). Then, to make this parameter suitable for subsequent integer threshold operations, according to the above formulas (3) and (4), Mapped to the integer range [1, 100] and subjected to conversion and scaling to limit the maximum output value and avoid signal overflow.

[0032] Further, in step S200, the current trigger threshold The audio sample values ​​mapped above Using the same digital unit, the sensitivity data after mapping processing Compared with the current trigger threshold It has a first correspondence, as shown in equation (8); where, sensitivity data The larger the threshold, the higher the current trigger threshold. The lower the sensitivity data The smaller the value, the lower the current trigger threshold. The higher.

[0033] (8) in, The high threshold for low-level sensitivity data. This refers to the low threshold value for high-level sensitivity data. In practice, if the audio input circuit or ADC static bias changes, simply replace the high and low threshold values ​​with the calibrated values. Current trigger threshold. The value range is determined based on the actual audio input circuit, ADC static bias point, peak noise level, and peak normal music level.

[0034] Preferably, in this embodiment Take 1750, Set to 1850; current trigger threshold. The value range is 1750~1850. Under silent or noisy conditions, the ADC value should be lower than this range, while the peak value of normal music beats should exceed this range.

[0035] Step S300: When the audio sample value Exceeding the current trigger threshold When the current state is in the allowed trigger state, the cooling state has ended, and the time interval since the last valid music trigger meets the preset visible trigger interval, a valid music trigger signal is generated, and the lighting effect is updated according to the current music sub-mode; wherein, after the valid music trigger signal is generated, the trigger permission is closed until the audio sampling value falls back to below the current trigger threshold minus the preset hysteresis amount, and then the allowed trigger state is re-entered.

[0036] Specifically, when the audio sample value The current trigger threshold has not been exceeded. At this time, it is only used as background audio data recording and does not generate beat triggering. When the audio sample value Exceeding the current trigger threshold Next, it checks whether the current state is in an enabled triggering state, whether the cooling count is 0 (indicating the end of the cooling state), and whether the time interval since the last valid music trigger signal is generated meets the preset visible trigger interval. If the current state is in an enabled triggering state, the cooling count is 0 (the cooling state is over), and the time interval since the last valid music trigger signal is generated meets the preset visible trigger interval, a valid music trigger signal is generated, and the cooling count is reset to a preset initial value (1 in this embodiment). The visible trigger interval is used to prevent ADC audio sampling values ​​from being... When the light effect changes too frequently when the threshold is exceeded continuously, it appears to the human eye as a random flickering or near-constant light.

[0037] Furthermore, with each lighting effect update, the system decrements the current cooling count by 1 until it reaches zero. That is, in the next scheduling cycle after a valid trigger signal is generated, the cooling count becomes 0, so that the system only intercepts the cycle immediately following the trigger moment, avoiding repeated triggering caused by the sampling residue of a single sound peak.

[0038] Further, in step S300, the method for determining the visible trigger interval includes: determining the visible trigger interval based on the current music sub-mode, wherein the current music sub-mode includes a jump sub-mode, a breathing sub-mode, a strobe sub-mode, and a gradation sub-mode; when the current music sub-mode is the jump sub-mode or the strobe sub-mode, the visible trigger interval is a first time interval; when the current music sub-mode is the breathing sub-mode or the gradation sub-mode, the visible trigger interval is a second time interval, wherein the first time interval is greater than the second time interval.

[0039] Specifically, the trigger interval is determined based on the current music sub-mode: the jump sub-mode and the strobe sub-mode are instantaneous change effects, so the trigger interval is taken as the first time interval. The breathing sub-mode and the gradient sub-mode are continuous transition effects, allowing for short trigger intervals. Therefore, the trigger interval is the second time interval. First time interval Greater than the second time interval . , It can be determined by comprehensively considering the ADC sampling period, the main loop refresh period, the speed of light effect changes, the rhythm of the target music, and the time of changes visible to the human eye.

[0040] Preferably, in this embodiment, the first time interval The value range is 220~350ms, preferably 260ms; the second time interval The value range is 80~180ms, with 120ms being preferred.

[0041] Furthermore, after the triggering conditions described in step S300 are met, a valid music trigger signal is generated and the system enters a cooling state for one cycle. No new valid music trigger signal can be generated before the cooling state ends, thus preventing the same sound peak from being repeatedly triggered in continuous sampling. Simultaneously, the duration of this valid music trigger signal is recorded to calculate the period between two adjacent valid triggers. In addition, a micro-pulse enhancement effect with a preset duration (preferably 70ms in this embodiment) is activated, resulting in a short-term enhancement of the RGB LED brightness for this beat. Further, in step S300, the system updates the RGB output of the lighting effect based on the effective beat period, trigger intensity, and current color wheel status. First, the time difference between the generation time of the effective music trigger signal in step S300 and the generation time of the previous effective music trigger signal is obtained: when this time difference is within a preset effective range (preferably 220~1200ms in this embodiment), the time difference is determined as the effective beat period. This effective beat period is used to determine the speed of light change corresponding to the lighting effect. In the generation of subsequent effective music trigger signals, the subsequent effective beat period is updated according to a smooth calculation method; if no effective beat period has been formed, the initial period (preferably 520ms in this embodiment) is used.

[0042] Preferably, the effective beat period is updated according to the smooth calculation method as shown in equation (9): (9) in, The effective cycle time before the update. The time difference between the current generation of a valid music trigger signal and the previous generation of a valid music trigger signal. This is the updated effective beat cycle.

[0043] Furthermore, if the audio sample value exceeds the current trigger threshold... Based on the audio sample value and the current trigger threshold The difference between the audio sample value and the current trigger threshold determines the trigger strength, and the corresponding light brightness for the output lighting effect is determined based on the trigger strength. The greater the trigger strength, the higher the light brightness for the corresponding lighting effect. Preferably, the difference between the audio sample value and the current trigger threshold is set. The difference is ,when If the value is less than 0, treat it as 0; then normalize it according to the set mapping range, for example... And restrict the numerical result to 0~1; the final trigger strength can be set according to Calculations show that weaker beats retain basic brightness, while stronger beats output brighter light; the greater the trigger intensity, the higher the brightness of the corresponding lighting effect. To avoid sudden changes in brightness, the trigger intensity can be adjusted. Further smoothing processing is then performed.

[0044] Further, after generating a valid music trigger signal, the valid color is determined based on the current color wheel state. The current color wheel state includes the color slot array, the current color index, and the number of valid colors: the color slot array can store up to 25 colors, each color contains three components: R, G, and B, and each component has a value from 0 to 255; invalid color slots can be excluded using an invalid flag. After each valid music trigger signal is generated, the system searches for the next valid color based on the position of the current color index in the color slot array. After finding the end, it returns to the starting slot loop to determine the currently output valid color. During RGB updates, the basic color C=(R,G,B) is first retrieved from the current color wheel slot. Then, based on the determined audio sample value, trigger intensity H, valid beat period P, preset brightness ratio B (user-defined global brightness ratio), and the brightness coefficient calculation rules corresponding to the current music sub-mode, the brightness coefficient V of the current music sub-mode is obtained, and finally, the RGB value of the current lighting effect is output. ), , , The output RGB values ​​are limited to a preset range (preferably 0~255 in this embodiment).

[0045] Furthermore, depending on the current music sub-mode type, the brightness coefficient V is generated according to the following rules: Luminance coefficient in jump sub-mode ; Brightness coefficient in breathing sub-mode ,in, The normalized respiratory envelope function has a rising edge duration of 90ms, a holding duration of 50ms, and a falling edge (decay) duration of max(1.8P, 1100ms). Peak coefficient in stroboscope sub-mode Its bright segment duration is max (0.10P, 35ms), and its tail segment duration is max (0.18P, 80ms). After the system detects 4 consecutive valid beats, it maintains a bottom brightness of no more than 0.60B. Under the gradient sub-pattern, the base coefficient And based on the normalized gradient envelope function Further modulation yields The decay time in this mode is max (0.60P, 160ms).

[0046] Furthermore, within 70ms after the above four sub-modes are triggered, the system additionally superimposes a micro-pulse gain with a maximum value of 0.35 that decays linearly over time to enhance the transient response effect at the moment of triggering. Finally, the system multiplies the total brightness coefficient V after the superposition of the micro-pulse gain with each component of the effective base color C to obtain the actual output RGB value of the current lighting effect. The calculated output component values ​​are limited to a preset range of 0 to 255, which are then used as the final RGB values ​​for driving the lighting effect.

[0047] Furthermore, the lighting effect rules corresponding to each music sub-mode are as follows: the jump sub-mode switches directly to the next color after generating a valid trigger signal; the breathing sub-mode forms a brightness envelope that goes from dark to bright and then back down according to the valid beat cycle; the strobe sub-mode outputs a short bright segment and quickly falls back down at the moment a valid trigger signal is generated; and the gradient sub-mode smoothly transitions between the current color and the next color according to the valid beat cycle.

[0048] Furthermore, according to Figure 2 As shown, after generating a valid music trigger signal, trigger permission is disabled until the audio sample value falls back to the current trigger threshold. Subtract the preset hysteresis ( Figure 2 After the audio sample value falls below the low threshold, it re-enters the trigger-allowed state, allowing the next trigger. In this embodiment, the preset hysteresis is preferably 1, which can prevent repeated false triggers when the audio value fluctuates near the threshold. The preset hysteresis can be adjusted according to the amplitude of the silent noise and the fluctuating range after filtering. If the ADC audio sample value is continuously higher than the current trigger threshold, the trigger permission remains closed; only after the above fallback judgment is completed will the next audio sample value exceeding the current trigger threshold be recognized as a new music beat and generate a valid music trigger signal. This embodiment improves the stability of music mode light effect triggering through the above multi-trigger condition joint judgment, so that the light effect can respond to sound changes, reduce invalid triggers and visual confusion, and make the overall display effect more natural.

[0049] Based on the same inventive concept, this invention also provides a light source music mode lighting effect triggering control system 300, as described in the following embodiments. Since the principle of the light source music mode lighting effect triggering control system 300 in solving the problem is similar to that of the light source music mode lighting effect triggering control method, the implementation of the light source music mode lighting effect triggering control system 300 can refer to the implementation of the light source music mode lighting effect triggering control method, and repeated details will not be elaborated further. As used below, the terms "unit" or "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0050] Figure 3 This is a structural block diagram of a light source music mode lighting effect triggering control system 300 according to an embodiment of this application, such as... Figure 3 As shown, it includes: The audio sampling module 301 is used to sample audio data at a preset period to obtain audio sample values; The threshold determination module 302 is used to acquire sensitivity data, perform mapping processing on the sensitivity data, and determine the current trigger threshold based on the mapped sensitivity data. The trigger determination module 303 is used to generate a valid music trigger signal when the audio sample value exceeds the current trigger threshold, and the current state is in the allowed trigger state, the cooling state has ended, and the time interval from the last valid music trigger meets the preset visible trigger interval; wherein, after generating the valid music trigger signal, the trigger permission is closed until the audio sample value falls back to below the current trigger threshold minus the preset hysteresis amount, and then the allowed trigger state is re-entered; The lighting effect update module 304 is used to update the lighting effect according to the current music sub-mode after the valid music trigger signal is generated.

[0051] In this embodiment, a computer device is also provided, such as... Figure 4 As shown, it includes a memory 401, a processor 402, and a computer program stored in the memory 401 and executable on the processor 402. When the processor 402 executes the computer program, it implements any of the above-mentioned light source music mode lighting effect triggering control methods.

[0052] Specifically, the computer device can be a computer terminal, a server, or a similar computing device.

[0053] In this embodiment, a storage medium is provided, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-described method for triggering and controlling the lighting effect of a light source in a music mode.

[0054] In this embodiment, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the light source music mode lighting effect triggering control method described above in this embodiment.

[0055] In this embodiment, a computer-readable storage medium is provided, which stores a computer program that executes any of the above-described light source music mode lighting effect triggering control methods.

[0056] Specifically, computer-readable storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media does not include transient media, such as modulated data signals and carrier waves.

[0057] The embodiments of the present invention achieve the following technical effects: 1. This application uses multi-condition triggering judgment. By combining trigger threshold, hysteresis and cooling state, the sound signal must complete a complete rise and fall process before the light effect can be triggered again. This can reduce false triggering caused by environmental noise, instantaneous spikes and continuous high levels, and avoid the light effect from flashing continuously in a short period of time. 2. This application sets different trigger rhythms according to different music sub-modes: longer trigger intervals are set for jump and strobe modes to avoid color switching and excessive flashing; shorter trigger intervals are set for breathing and gradient modes to maintain the continuity of light effect changes and make them more in line with the music rhythm. 3. This application can improve the stability of music mode lighting effect triggering without changing the basic audio sampling hardware, so that the lighting effect can respond to sound changes, reduce invalid triggering and visual confusion, and make the overall display effect more natural.

[0058] Finally, it should be noted that the above 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 or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for triggering and controlling the lighting effect of a music mode using a light source, characterized in that, include: Audio data is sampled at a preset period to obtain audio sample values; Acquire sensitivity data, perform mapping processing on the sensitivity data, and determine the current trigger threshold based on the mapped sensitivity data. The mapped sensitivity data and the current trigger threshold have a first correspondence relationship. The larger the mapped sensitivity data, the lower the current trigger threshold. The smaller the mapped sensitivity data, the higher the current trigger threshold. When the audio sample value exceeds the current trigger threshold, and the current state is in the allowed trigger state, the cooling state has ended, and the time interval since the last valid music trigger meets the preset visible trigger interval, a valid music trigger signal is generated, and the lighting effect is updated according to the current music sub-mode; wherein, after the valid music trigger signal is generated, the trigger permission is closed until the audio sample value falls back to below the current trigger threshold minus the preset hysteresis amount, and then the allowed trigger state is re-entered.

2. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 1, characterized in that, Mapping the sensitivity data includes: The sensitivity data is normalized to a first value; Select the corresponding curve gain according to the current music sub-mode and determine the non-linear mapping relationship, and map the first value to the second value based on the non-linear mapping relationship; After the second value is converted and scaled according to a preset method, the sensitivity data after mapping is obtained.

3. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 1, characterized in that, The method for determining the visible trigger interval includes: The visible trigger interval is determined based on the current music sub-mode, which includes a jump sub-mode, a breathing sub-mode, a strobe sub-mode, and a fade sub-mode. When the current music sub-mode is the jump sub-mode or the strobe sub-mode, the visible trigger interval is the first time interval; When the current music sub-mode is the breathing sub-mode or the gradient sub-mode, the visible trigger interval is the second time interval, and the first time interval is greater than the second time interval.

4. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 1, characterized in that, After generating the valid music trigger signal, the system enters the cooling state and activates a micro-pulse enhancement effect of a preset duration. No new valid music trigger signal can be generated before the cooling state ends. The micro-pulse enhancement effect is used to enhance the brightness of the LED beads corresponding to the lighting effect.

5. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 1, characterized in that, The step of updating the lighting effects according to the current music sub-mode includes: Obtain the time difference between the generation time of the valid music trigger signal and the generation time of the previous valid music trigger signal; When the time difference is within a preset valid range, the time difference is determined as a valid beat period. The valid beat period is used to determine the light change speed corresponding to the light effect, and the valid beat period corresponding to the subsequently generated valid music trigger signal is updated according to a smooth calculation method.

6. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 5, characterized in that, The method of updating the lighting effects according to the current music sub-mode also includes: If the audio sample value exceeds the current trigger threshold, the trigger strength is determined based on the difference between the audio sample value and the current trigger threshold; The light brightness corresponding to the light effect is determined based on the trigger intensity. The greater the trigger intensity, the higher the light brightness corresponding to the light effect.

7. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 6, characterized in that, The method of updating the lighting effects according to the current music sub-mode also includes: After generating the valid music trigger signal, the valid color is determined according to the current color wheel state, which includes a color slot array, a current color index, and a number of valid colors. The valid color is determined according to the position of the current color index in the color slot array. Based on the audio sample value, the trigger intensity, the effective beat period, and the brightness coefficient calculation rule corresponding to the current music sub-mode, the brightness coefficient of the current music sub-mode is obtained. The RGB values ​​of the lighting effect output are determined based on the effective color and brightness coefficient, and the RGB values ​​are limited to a preset range.

8. The method for triggering and controlling the lighting effect of a music mode using a light source according to claim 1, characterized in that, The process of obtaining audio sample values ​​includes: The valid value of the sampled audio data is determined by judging the validity of the sampled values, and the audio sampled value is determined based on the judgment result. The valid value judgment includes the judgment of the legal range, the limiting of outlier values, and the elimination of silence noise.

9. A light source-based music mode lighting effect triggering control system, characterized in that, The system is used to implement the light source machine music mode lighting effect triggering control method according to any one of claims 1 to 8, the system comprising: The audio sampling module is used to sample audio data at preset intervals to obtain audio sample values; The threshold determination module is used to acquire sensitivity data, perform mapping processing on the sensitivity data, and determine the current trigger threshold based on the mapped sensitivity data. The trigger determination module is used to generate a valid music trigger signal when the audio sample value exceeds the current trigger threshold, and the current state is in the allowed trigger state, the cooling state has ended, and the time interval since the last valid music trigger meets the preset visible trigger interval; wherein, after generating the valid music trigger signal, the trigger permission is closed until the audio sample value falls back to below the current trigger threshold minus the preset hysteresis amount, and then the allowed trigger state is re-entered; The lighting effect update module is used to update the lighting effect according to the current music sub-mode after the valid music trigger signal is generated.