Atmosphere lamp control method, device, equipment and storage medium
Patent Information
- Application Number
- CN202310652157.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-02
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-06-02
AI Technical Summary
[0003]目前,氛围灯的控制方式较为简单或单一,例如,控制氛围灯显示预先设定的一种或多种颜色,或者人工调整氛围灯的灯光颜色
[0017]以上方案,分析目标音乐数据的音乐情感数据,确定与音乐情感数据匹配且时序同步的灯光颜色配置数据;并基于灯光颜色配置数据,随目标音乐数据的播放进程同步控制氛围灯。由于灯光颜色配置数据与目标音乐数据的音乐情感数据匹配且时序同步,能够在播放目标音乐数据的过程中,根据目标音乐数据的音乐情感以及音乐情感变化,同步控制氛围灯显示与目标音乐数据的音乐情感相匹配的灯光颜色,即能够实现控制氛围灯的灯光颜色同步烘托目标音乐数据的音乐情感,从而为用户营造沉浸式的视觉感受,提高氛围灯的灯光效果。
Smart Images

Figure CN116887486B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lighting control technology, and in particular to a method, apparatus, device, and storage medium for controlling ambient lighting. Background Technology
[0002] Ambient lighting is commonly installed in places such as car interiors, exhibition halls, concert venues, hotels, and karaoke bars. By controlling the ambient lights to emit different colors of light, different atmospheres can be created, thereby meeting users' personalized needs and improving the user experience.
[0003] Currently, ambient lighting control methods are relatively simple or limited. For example, the ambient light can be controlled to display one or more preset colors, or the color of the light can be manually adjusted. Using this method results in poor lighting effects. Summary of the Invention
[0004] The main technical problem solved by this invention is to provide a control method, device, equipment and computer-readable storage medium for ambient lights, which can improve the lighting effect of ambient lights.
[0005] To solve the above-mentioned technical problems, one technical solution adopted in this application is: to provide a method for controlling ambient lights, the method comprising: analyzing the musical emotion data of target music data; determining light color configuration data that matches the musical emotion data and is time-synchronized; and controlling the light color of the ambient lights synchronously with the playback process of the target music data based on the light color configuration data.
[0006] The analysis of musical emotion data of the target music data includes: determining the chord data of the target music data, wherein the chord data includes at least one target chord; for each target chord, selecting the musical emotion corresponding to the target chord from the first mapping relationship as the target musical emotion of the target chord; wherein the first mapping relationship includes the preset musical emotions corresponding to several preset chords respectively, and the target chord belongs to several preset chords.
[0007] The target music data includes a music segment with at least one beat. Determining the chord data of the target music data includes: determining the first chord arrangement vector corresponding to each preset chord, and determining the second chord arrangement vector corresponding to each music segment; for each music segment, determining the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment; and determining the target chord of the music segment based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment.
[0008] Specifically, determining the target chord of a music segment based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment includes: taking the preset chord corresponding to the first chord arrangement vector with the highest similarity as the target chord of the music segment.
[0009] Specifically, determining the target chord of a music segment based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment includes: taking the preset chord corresponding to the first chord arrangement vector with the highest similarity and a similarity greater than a preset threshold as the target chord of the music segment.
[0010] The music segment includes multiple music sub-segments. Determining the second chord arrangement vector corresponding to each music segment includes: determining the pitch energy vector of each music sub-segment, where the pitch energy vector includes the energy corresponding to several preset pitches; and determining the second chord arrangement vector of the music segment based on the pitch energy vector of each music sub-segment.
[0011] Specifically, determining the second chord arrangement vector of a musical segment based on the pitch energy vectors of each musical sub-segment includes: extracting the pitch with the highest energy from each pitch energy vector; and obtaining the second chord arrangement vector based on the extracted pitch with the highest energy from each pitch energy vector.
[0012] The process of determining light color configuration data that matches and is time-synchronized with the music emotion data includes: determining a target light color that matches the music emotion data; and obtaining light color configuration data that is time-synchronized with the music emotion data based on the target light color.
[0013] The music emotion data includes at least one target music emotion. Determining the target light color that matches the music emotion data includes: selecting a light color corresponding to the target music emotion from a second mapping relationship as the target light color corresponding to the target music emotion; wherein the second mapping relationship includes several preset light colors corresponding to preset music emotions respectively.
[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an ambient light control device, the device comprising: an analysis module for analyzing the musical emotion data of the target music data; a determination module for determining the light color configuration data that matches and is time-synchronized with the musical emotion data; and a control module for controlling the light color of the ambient light synchronously with the playback progress of the target music data based on the light color configuration data.
[0015] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program instructions; and the processor is used to execute the program instructions stored in the memory to implement the above-mentioned ambient light control method.
[0016] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing program instructions that can be executed by a processor to implement the above-mentioned ambient light control method.
[0017] The above solution analyzes the emotional data of the target music data to determine the lighting color configuration data that matches and is time-synchronized with the emotional data. Based on the lighting color configuration data, the ambient lights are controlled synchronously as the target music data plays. Because the lighting color configuration data matches and is time-synchronized with the emotional data of the target music data, the ambient lights can be controlled to display colors that match the emotional content of the target music data during playback. This allows the ambient lights to synchronously enhance the emotional content of the target music data, creating an immersive visual experience for the user and improving the lighting effect. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating an embodiment of the ambient light control method provided in this application;
[0019] Figure 2 This is a flowchart illustrating another embodiment of the ambient light control method provided in this application;
[0020] Figure 3 This is a flowchart illustrating an embodiment of the method for determining a target chord provided in this application;
[0021] Figure 4 This is a schematic diagram of the framework of an embodiment of the ambient light control device provided in this application;
[0022] Figure 5 This is a schematic diagram of the framework of an embodiment of the electronic device provided in this application;
[0023] Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0024] To make the purpose, technical solution and effects of this application clearer and more explicit, the following describes this application in further detail with reference to the accompanying drawings and embodiments.
[0025] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0026] If the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0027] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the ambient lighting control method provided in this application. It should be noted that if substantially the same result is achieved, the method of this invention is not necessarily identical. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, the method includes the following steps:
[0028] S11: Analyze the musical emotional data of the target music data.
[0029] Musical emotion is the artistic expression of everyday emotions in music. For example, cheerful music expresses happiness and positive emotions; passionate music expresses excitement and fervor; and simple and peaceful music expresses relaxation and inner peace.
[0030] In this embodiment, the musical emotion data of the target music data includes at least one target musical emotion. For example, the target musical emotion can be melodious and gentle, passionate, simple, calm, a sense of conclusion, or a sense of continuation, etc. Among these, melodious and gentle is typically the style of pop music or love songs; passionate is typically the style of rock music or K-pop; simple or calm is typically the style of folk music; and a sense of conclusion or continuation is typically the style of classical music.
[0031] In one embodiment, the chord data of the target music data can be determined first, including at least one target chord; then, the music emotion data corresponding to the target music data can be determined according to the mapping relationship between chords and music emotion.
[0032] In another embodiment, the target music data can be input into a first neural network model, which then predicts the musical emotion data of the target music data. For example, the first neural network model is trained using a large amount of sample music data. For instance, the first neural network model predicts the sample music data to obtain a sample musical emotion result. Based on a first difference between the sample musical emotion result and the actual musical emotion result of the sample music data, the parameters of the first neural network model are adjusted until the first neural network model converges or the first difference is less than a first difference threshold, thus obtaining a trained first neural network model. The first difference threshold is set according to actual needs.
[0033] It should be noted that the target music data in this embodiment can be the music data corresponding to one or more complete songs, or it can be the music data corresponding to a part of a song. The target music data can be music with lyrics or instrumental music without lyrics; this embodiment does not specifically limit this. For example, the target music data is in PCM (Pulse-code modulation) file format or WAV (Wave Form) file format.
[0034] In one example, the target music data can be retrieved from the local storage unit, or a portion of the music data can be extracted from a music file retrieved from the local storage unit as the target music data.
[0035] In another example, target music data can be obtained from an external source through a data transfer interface, or a portion of music data can be extracted from a music file obtained from an external source through a data transfer interface as the target music data.
[0036] S12: Determine the lighting color configuration data that matches and is time-synchronized with the music emotion data of the target music data.
[0037] In this embodiment, the light color configuration data includes at least the light color of the ambient light. For example, the ambient light includes a number of LED beads.
[0038] In one example, the light color configuration data only includes the light color of the ambient light.
[0039] In another example, the light color configuration data, in addition to the ambient light color, may also include at least one of the following: the target LED bead to be lit, the brightness of the target LED bead, the lighting duration of the target LED bead, and the lighting method of the target LED bead. For example, the lighting method of the target LED bead may be continuous lighting, breathing light lighting, etc.
[0040] In this embodiment, matching the light color configuration data with the musical emotion data of the target music data means that the light color configuration data can indirectly reflect the musical emotion of the target music data. For example, if the target musical emotion data includes melodious and gentle, the matching light color is indigo; or if the target musical emotion data includes passion, the matching light color is crimson.
[0041] In this embodiment, the time synchronization of the light color configuration data and the musical emotion data of the target music data means that the light color configuration data and the musical emotion data of the target music data are consistent on the time axis. For example, if the musical emotion data of the target music data is passionate during a certain time period, the light color during that time period is crimson.
[0042] S13: Based on the light color configuration data, the ambient light color is controlled synchronously with the playback progress of the target music data.
[0043] In one embodiment, after analyzing all the musical emotion data of the target music data and determining the lighting color configuration data that matches and is time-synchronized with the musical emotion data of the target music data, the lighting color of the ambient light is controlled synchronously during the playback of the target music data.
[0044] In another embodiment, the target music data and the ambient light color can be controlled simultaneously while analyzing the emotional data of the target music data and determining the matching and time-synchronized light color configuration data. For example, after analyzing the emotional data of a portion of the target music data and determining the matching and time-synchronized light color configuration data, the ambient light color is controlled synchronously while playing that portion of the target music data; and while playing that portion of the target music data and controlling the ambient light color, the emotional data of another portion of the target music data is analyzed simultaneously, and the matching and time-synchronized light color configuration data is determined.
[0045] In this embodiment, the emotional data of the target music data is analyzed to determine the lighting color configuration data that matches and is time-synchronized with the emotional data. Based on the lighting color configuration data, the ambient lights are controlled synchronously as the target music data is played. Because the lighting color configuration data matches and is time-synchronized with the emotional data of the target music data, the ambient lights can be controlled to display lighting colors that match the emotional content of the target music data during playback, based on the emotional content and changes in that content. This allows the ambient lights to synchronously enhance the emotional content of the target music data, creating an immersive visual experience for the user and improving the lighting effect.
[0046] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the ambient lighting control method provided in this application. Figure 2 As shown, the method includes the following steps:
[0047] S21: Determine the chord data of the target music data, which includes at least one target chord.
[0048] For details regarding the target music data, please refer to step S11 above, which will not be described in detail here.
[0049] In this embodiment, the target music data includes music segments with at least one beat. For each music segment, a chord arrangement vector is determined, and the target chord for that music segment is obtained based on the chord arrangement vector. Considering that the beat of the music usually changes at the beat points where chords change, before determining the chord data of the target music data, beat detection is performed on the target music data to determine the beat points of the target music data, thereby dividing the target music data into music segments with at least one beat.
[0050] Please see Figure 3 , Figure 3 This is a flowchart illustrating an embodiment of the method for determining a target chord provided in this application. Figure 3 As shown, the method includes the following steps:
[0051] S301, determine the first chord arrangement vector corresponding to each preset chord, and determine the second chord arrangement vector corresponding to each music segment.
[0052] In this embodiment, preset chords are set in advance, and there are multiple preset chords. For example, the preset chords are classical chords, such as canon chords ("15634125"), circle of fifth chords ("1526415"), "1645" chords, "145" chords, etc.
[0053] The first chord arrangement vector corresponding to each preset chord is used to represent the arrangement of notes corresponding to each preset chord, and the second chord arrangement vector corresponding to each musical segment is used to represent the arrangement of notes corresponding to each musical segment. For example, the first chord arrangement vector corresponding to the canon chord ("15634125") is [1,5,6,3,4,1,2,5].
[0054] In this embodiment, the music segment includes multiple music sub-segments. For example, the music segment within each beat is divided into multiple music sub-segments according to a set time interval, and the set time interval is set according to actual needs. Determining the second chord arrangement vector corresponding to each music segment includes: determining the pitch energy vector of each music sub-segment; and determining the second chord arrangement vector of the music segment based on the pitch energy vector of each music sub-segment. The pitch energy vector includes the energy corresponding to several preset pitches. The number of preset pitches is 12. The preset pitches include pitches C, D, E, F, G, A, and B, wherein each of the following pairs includes one pitch: C and D, D and E, F and G, G and A, and A and B.
[0055] In one embodiment, determining the pitch energy vector of each musical sub-segment includes the following steps: performing a Fourier transform on each musical segment to convert each musical segment from a time-domain signal to a frequency-domain signal; performing noise reduction processing on the frequency-domain signal corresponding to each musical segment; tuning the noise-reduced frequency-domain signal to tune it to a standard frequency; dividing each musical segment into multiple musical sub-segments according to the aforementioned set time interval; and recording the energy of each preset pitch level for each musical sub-segment to obtain the pitch energy vector.
[0056] In one embodiment, to reduce the computational complexity of subsequently calculating the similarity between each first chord arrangement vector and the second chord arrangement vector, the second chord arrangement vector of the music segment is determined based on the pitch energy vector of each music sub-segment, including: extracting the pitch with the highest energy from each pitch energy vector; and obtaining the second chord arrangement vector based on the extracted pitch with the highest energy from each pitch energy vector.
[0057] For example, a certain music segment includes music sub-segment 1, music sub-segment 2, and music sub-segment 3. The highest energy pitches in the pitch energy vectors of music sub-segment 1, music sub-segment 2, and music sub-segment 3 are C, E, and G, respectively. According to basic music knowledge, the numbers corresponding to C, E, and G are 1, 3, and 5, respectively. Therefore, the second chord arrangement vector is [1,3,5].
[0058] S302, For each music segment, determine the similarity between the first chord arrangement vector and the second chord arrangement vector of the music segment.
[0059] In one embodiment, the similarity between each first chord arrangement vector and the second chord arrangement vector of a musical segment is determined by calculating the edit distance between them. The edit distance between the first and second chord arrangement vectors refers to the minimum number of editing operations required to convert the second chord arrangement vector into a first chord arrangement vector, where editing operations include deletion, insertion, and replacement. A smaller edit distance indicates a greater similarity between the second and first chord arrangement vectors; a larger edit distance indicates a smaller similarity.
[0060] The edit distance between each first chord arrangement vector and the second chord arrangement vector of the music segment can be calculated using the following formula:
[0061]
[0062] In formula (1), i and j represent the subscripts of the first chord arrangement vector a and the second chord arrangement vector b, respectively, and i and j start from 1.
[0063] It should be noted that this embodiment only uses the edit distance algorithm to determine the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment as an example. In other embodiments, other similarity calculation algorithms can also be used to determine the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment, and this embodiment does not specifically limit this.
[0064] S303, Based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment, determine the target chord of the music segment.
[0065] In one embodiment, the preset chord corresponding to the first chord arrangement vector with the highest similarity is used as the target chord of the music segment. When the second chord arrangement vector corresponding to the music segment has the highest similarity to a certain first chord arrangement vector, it indicates that the second chord arrangement vector corresponding to the music segment is closest to the first chord arrangement vector.
[0066] In one embodiment, the preset chord corresponding to the first chord arrangement vector with the highest similarity and a similarity greater than a preset threshold is used as the target chord of the music segment. For example, when the edit distance algorithm is used to calculate the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment, if the edit distance is less than a preset parameter value, it indicates that the similarity is greater than the preset threshold.
[0067] In addition to the aforementioned preset chords (classical chords), the chords also include several adapted chords obtained by modifying each preset chord. Modification operations can include inversion, adding chord components, or deleting chord components. For example, in the basic canon progression, replacing the '5' with the '3' and placing the chord's third at the lowest position yields the canon variant "13634325," which is the first inversion of the canon chord. Modifying preset chords can achieve subtle changes in sound, providing a richer auditory experience. Considering that musical fragments with similar chord arrangements have similar sound and style, and similar musical emotions, they can produce similar emotional effects. Therefore, in steps S301 to S303, the target chord of the musical fragment is determined based on the similarity between the first chord arrangement vector and the second chord arrangement vector of the musical fragment. On the one hand, this avoids discarding a large number of adapted chords obtained from modifying classic chords; on the other hand, it facilitates directly determining the musical emotions of several adapted chords based on the musical emotions of classic chords.
[0068] S22: For each target chord, select the musical emotion corresponding to the target chord from the first mapping relationship, and use it as the target musical emotion of the target chord.
[0069] The first mapping relationship includes several preset chords corresponding to preset musical emotions, and the target chord belongs to several preset chords. In the first mapping relationship, different preset chords can correspond to different preset musical emotions, or different preset chords can correspond to the same preset musical emotion. The first mapping relationship is preset and stored according to actual needs.
[0070] For example, the first mapping relationship includes four preset chords: Canon chord ("15634125"), circle of fifth chord ("1526415"), "1645" chord, and "145" chord. The preset musical mood corresponding to the Canon chord ("15634125") is melodious and gentle, the preset musical mood corresponding to the circle of fifth chord ("1526415") is passionate, the preset musical mood corresponding to the "1645" chord is simple and peaceful, and the preset musical mood corresponding to the "145" chord is a sense of ending and continuation.
[0071] In steps S21 and S22, at least one target chord included in the target music data is first determined, and then the target musical emotion corresponding to each target chord is determined based on the first mapping relationship. Since music is usually defined by chords to define different musical emotions, the target musical emotion corresponding to each target chord can be quickly determined through the pre-set first mapping relationship.
[0072] Optionally, in this embodiment, the chord data of the target music data can also be predicted directly through the second neural network model. Specifically, the target music data is input into the second neural network model, and the second neural network model predicts the target chords included in the target music data. For example, the second neural network model is trained with a large amount of sample music data. For instance, the second neural network model predicts the sample music data to obtain sample chord results. Based on the second difference between the sample chord results and the actual chord results of the sample music data, the parameters of the second neural network model are adjusted until the second neural network model converges or the second difference is less than a second difference threshold, thus obtaining a trained second neural network model. The second difference threshold is set according to actual needs.
[0073] S23: Determine the lighting color configuration data that matches and is time-synchronized with the music emotion data of the target music data.
[0074] In this embodiment, step S23 includes: determining the target light color that matches the music emotion data; and obtaining light color configuration data that is time-synchronized with the music emotion data based on the target light color.
[0075] In one embodiment, the music emotion data includes at least one target music emotion. Determining a target light color that matches the music emotion data includes: selecting a light color corresponding to the target music emotion from a second mapping relationship, as the target light color corresponding to the target music emotion. The second mapping relationship includes several preset light colors corresponding to preset music emotions.
[0076] In the second mapping relationship, different preset musical emotions correspond to different preset light colors. For example, in the second mapping relationship, when the preset musical emotion is melodious and gentle, the corresponding preset light color is indigo; when the preset musical emotion is passionate, the corresponding preset light color is crimson; when the preset musical emotion is simple and peaceful, the corresponding preset light color is purple; and when the preset musical emotion is a sense of ending or continuation, the corresponding preset light color is dark blue.
[0077] In one embodiment, the start time of the light color configuration data corresponding to the target light color is consistent with the start time of the matching target music emotion, and the end time of the light color configuration data corresponding to the target light color is consistent with the end time of the matching target music emotion, thereby synchronizing the light color configuration data and the music emotion data. In addition to the target light color of the ambient light, the light color configuration data may also include at least one of the following: the target LED light to be illuminated under the target light color, the brightness of the target LED light, the illumination duration of the target LED light, and the illumination method of the target LED light.
[0078] S24: Based on the light color configuration data, the ambient light color is controlled synchronously with the playback progress of the target music data.
[0079] In one embodiment, a level signal is generated based on light color configuration data that matches and is time-synchronized with the music emotion data of the target music data, and the level signal is sent to each LED of the ambient light to control the light color of the ambient light.
[0080] In this embodiment, the musical emotion data of the target music data is analyzed to determine the lighting color configuration data that matches and is time-synchronized with the musical emotion data. Based on the lighting color configuration data, the ambient lights are controlled synchronously as the playback progress of the target music data. Because the lighting color configuration data matches and is time-synchronized with the musical emotion data of the target music data, the ambient lights can be controlled to display lighting colors that match the musical emotion of the target music data during playback, based on the musical emotion and changes in the musical emotion of the target music data. This allows the ambient lights to synchronously enhance the musical emotion of the target music data, thereby creating a "harmonious sound" visual experience for the user and improving the lighting effect of the ambient lights.
[0081] Please see Figure 4 , Figure 4 This is a schematic diagram of a framework of an embodiment of the ambient light control device provided in this application. In this embodiment, the ambient light control device 40 includes: an analysis module 41, a determination module 42, and a control module 43. The analysis module 41 is used to analyze the musical emotion data of the target music data. The determination module 42 is used to determine light color configuration data that matches the musical emotion data and is time-synchronized. The control module 43 is used to synchronously control the ambient light color based on the light color configuration data, following the playback progress of the target music data.
[0082] Optionally, the analysis module 41 is used to determine the chord data of the target music data, the chord data including at least one target chord; for each target chord, the musical emotion corresponding to the target chord is selected from the first mapping relationship as the target musical emotion of the target chord; wherein, the first mapping relationship includes several musical emotions corresponding to several preset chords respectively, and the target chord belongs to several preset chords.
[0083] Optionally, the target music data includes a music segment with at least one beat. The analysis module 41 is used to determine the first chord arrangement vector corresponding to each preset chord and the second chord arrangement vector corresponding to each music segment. For each music segment, the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment is determined. Based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the music segment, the target chord of the music segment is determined.
[0084] Optionally, the analysis module 41 is used to take the preset chord corresponding to the first chord arrangement vector with the highest similarity as the target chord of the music segment.
[0085] Optionally, the analysis module 41 is used to select the preset chord corresponding to the first chord arrangement vector with the highest similarity and a similarity greater than a preset threshold as the target chord of the music segment.
[0086] Optionally, the music segment includes multiple music sub-segments. The analysis module 41 is used to determine the pitch energy vector of each music sub-segment. The pitch energy vector includes the energy corresponding to several preset pitches. Based on the pitch energy vector of each music sub-segment, the second chord arrangement vector of the music segment is determined.
[0087] Optionally, the analysis module 41 is used to extract the highest energy level from each pitch energy vector; based on the extracted highest energy level from each pitch energy vector, the second chord arrangement vector is obtained.
[0088] Optionally, the determining module 42 is used to determine the target light color that matches the music emotion data; based on the target light color, light color configuration data that is time-synchronized with the music emotion data is obtained.
[0089] Optionally, the music emotion data includes at least one target music emotion, and the determining module 42 is used to select a light color corresponding to the target music emotion from the second mapping relationship as the target light color corresponding to the target music emotion; wherein, the second mapping relationship includes several preset light colors corresponding to preset music emotions respectively.
[0090] It should be noted that the apparatus of this embodiment can perform the steps in the above method. For detailed descriptions of the relevant content, please refer to the method section above, which will not be repeated here.
[0091] Please see Figure 5 , Figure 5 This is a schematic diagram of a framework of an embodiment of the electronic device provided in this application. In this embodiment, the electronic device 50 includes a memory 51 and a processor 52.
[0092] Processor 52 can also be referred to as CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor can be a microprocessor, or processor 52 can be any conventional processor 52, etc.
[0093] The memory 51 in the electronic device 50 is used to store the program instructions required for the processor 52 to run.
[0094] The processor 52 is used to execute program instructions to implement the ambient light control method in this application.
[0095] Please see Figure 6 , Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 60 of this embodiment stores program instructions 61, which, when executed, implement the ambient light control method provided in this application. The program instructions 61 can be formed into a program file and stored in the aforementioned computer-readable storage medium 60 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 60 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0096] The above solution analyzes the emotional data of the target music data to determine the lighting color configuration data that matches and is time-synchronized with the emotional data. Based on the lighting color configuration data, the ambient lights are controlled synchronously as the target music data plays. Because the lighting color configuration data matches and is time-synchronized with the emotional data of the target music data, the ambient lights can be controlled to display colors that match the emotional content of the target music data during playback. This allows the ambient lights to synchronously enhance the emotional content of the target music data, creating an immersive visual experience for the user and improving the lighting effect.
[0097] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0098] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0099] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or units may be electrical, mechanical, or other forms.
[0100] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0101] 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.
[0102] 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, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0103] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for controlling ambient lighting, characterized in that, The method includes: Analyzing the musical emotion data of target music data, wherein the musical emotion data includes at least one target musical emotion; the analysis of the musical emotion data of target music data includes: determining the chord data of the target music data, wherein the chord data includes at least one target chord; for each target chord, selecting the musical emotion corresponding to the target chord from a first mapping relationship as the target musical emotion of the target chord; wherein the first mapping relationship includes preset musical emotions corresponding to several preset chords respectively, and the target chord belongs to the several preset chords; the target music data includes a musical segment with at least one beat, and determining the chord data of the target music data includes: determining a first chord arrangement vector corresponding to each preset chord, and determining a second chord arrangement vector corresponding to each musical segment respectively; for each musical segment, determining the similarity between each first chord arrangement vector and the second chord arrangement vector of the musical segment respectively; based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the musical segment, determining the target chord of the musical segment; Determine light color configuration data that matches and is time-synchronized with the music emotion data, wherein the light color configuration data can indirectly reflect the music emotion of the target music data; Based on the light color configuration data, the ambient light color is controlled synchronously with the playback progress of the target music data.
2. The method according to claim 1, characterized in that, Determining the target chord of the music segment based on the similarity between each of the first chord arrangement vectors and the second chord arrangement vectors of the music segment includes: The preset chord corresponding to the first chord arrangement vector with the highest similarity is taken as the target chord of the music segment.
3. The method according to claim 1, characterized in that, Determining the target chord of the music segment based on the similarity between each of the first chord arrangement vectors and the second chord arrangement vectors of the music segment includes: The preset chord corresponding to the first chord arrangement vector with the highest similarity and a similarity greater than a preset threshold is taken as the target chord of the music segment.
4. The method according to claim 1, characterized in that, The music segment includes multiple music sub-segments, and determining the second chord arrangement vector corresponding to each of the music segments includes: The pitch energy vectors of each musical sub-segment are determined, and the pitch energy vectors include the energy corresponding to several preset pitches. Based on the pitch energy vectors of each musical sub-fragment, the second chord arrangement vector of the musical fragment is determined.
5. The method according to claim 4, characterized in that, Determining the second chord arrangement vector of a musical segment based on the pitch energy vector of each musical sub-segment includes: Extract the highest-energy pitch from the energy vector of each pitch level; The second chord arrangement vector is obtained based on the highest energy level among the extracted energy vectors of each pitch level.
6. The method according to claim 1, characterized in that, The determination of the light color configuration data that matches and is time-synchronized with the music emotion data includes: Determine the target light color that matches the music emotion data; Based on the target light color, light color configuration data is obtained that is synchronized with the music emotion data in time.
7. The method according to claim 6, characterized in that, The music emotion data includes at least one target music emotion, and determining the target light color that matches the music emotion data includes: Select a light color that corresponds to the target music emotion from the second mapping relationship, and use it as the target light color corresponding to the target music emotion; The second mapping relationship includes several preset light colors corresponding to preset musical emotions.
8. A control device for an ambient light, characterized in that, The device includes: An analysis module is used to analyze the musical emotion data of target music data, wherein the musical emotion data includes at least one target musical emotion; the analysis module is used to determine the chord data of the target music data, wherein the chord data includes at least one target chord; for each target chord, a musical emotion corresponding to the target chord is selected from a first mapping relationship as the target musical emotion of the target chord; wherein the first mapping relationship includes preset musical emotions corresponding to several preset chords respectively, and the target chord belongs to the several preset chords; the target music data includes a musical segment with at least one beat, and the analysis module is used to determine the first chord arrangement vector corresponding to each preset chord and the second chord arrangement vector corresponding to each musical segment respectively; for each musical segment, the similarity between each first chord arrangement vector and the second chord arrangement vector of the musical segment is determined; based on the similarity between each first chord arrangement vector and the second chord arrangement vector of the musical segment, the target chord of the musical segment is determined; The determination module is used to determine light color configuration data that matches and is time-synchronized with the music emotion data, wherein the light color configuration data can indirectly reflect the music emotion of the target music data; The control module is used to control the ambient light color synchronously with the playback progress of the target music data based on the light color configuration data.
9. An electronic device, characterized in that, Including interconnected memory and processor, The memory stores program instructions; The processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed by a processor to implement the method of any one of claims 1-7.
Citation Information
Patent Citations
Music automatic classification method and device, computer equipment and storage medium
CN110472097A
Control method and device of vehicle-mounted atmosphere lamp, vehicle and storage medium
CN112839416A
Atmosphere lamp display method and device based on music, equipment and storage medium
CN114828359A