Method, apparatus, and computer-readable storage medium for generating background music

By determining the target beat number of initial music in computer software and selecting virtual instruments, combining the sound with the reception time of triggering instructions, the problem of high threshold for creating accompaniment music in the prior art is solved, and the functions are enriched and the threshold is reduced.

CN111933098BActive Publication Date: 2025-06-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010784925.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-06
Publication Date
2025-06-27
Estimated Expiration
2040-08-06

AI Technical Summary

Technical Problem

Existing computer software related to music creation has a high threshold for creating accompaniment music. Users need to have a strong sense of music and familiarity with the style of instrumental playing, and their functions are relatively single.

Method used

By determining the target beat number of the initial music, selecting the appropriate virtual instrument, and combining the sound according to the reception time of the trigger command, accompaniment music is generated.

Benefits of technology

It lowers the threshold for creating accompaniment music, allowing users to generate accompaniment music that is adapted to the initial music without having professional music knowledge, and enriches the functions of the music software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111933098B_ABST
    Figure CN111933098B_ABST
Patent Text Reader

Abstract

The present application discloses a method, an apparatus, and a computer-readable storage medium for generating accompaniment music, belonging to the field of computer technology. The method includes: determining a target beat count of an initial music, where the target beat count is the number of beats per minute of the initial music; determining a target virtual instrument corresponding to the beat count range in which the target beat count is located among virtual instruments corresponding to at least two beat count ranges; during the playback of the initial music, receiving at least two trigger instructions for the target virtual instrument; and combining the sounds of the target virtual instrument indicated by each of the at least two trigger instructions according to the reception times of the at least two trigger instructions to obtain the accompaniment music. The present application solves the problem that the functions of computer software related to music creation are relatively single. The present application is used for generating accompaniment music.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a method and apparatus for generating accompaniment music and a computer-readable storage medium. Background Art

[0002] With the development of computer technology, computer software related to music creation has gradually been widely used.

[0003] In related technologies, computer software can provide a variety of virtual musical instruments. Users can trigger the virtual musical instruments in the computer software to simulate the sounds of corresponding physical musical instruments, and thus can create music without physical musical instruments. However, when creating accompaniment music for a certain piece of music through computer software, users still need to have a strong and sensitive musical sense experience to perceive the tone style of the piece of music, and also need to be familiar with the playing styles and emotional expression methods of various musical instruments, and then can select appropriate virtual musical instruments to create accompaniment music that fits the piece of music.

[0004] Therefore, the threshold for creating accompaniment music using computer software in related technologies is relatively high, and the functions of computer software related to music creation are relatively single. Summary of the Invention

[0005] This application provides a method and apparatus for generating accompaniment music and a computer-readable storage medium, which can solve the problem that the functions of computer software related to music creation are relatively single. The technical solutions are as follows:

[0006] On the one hand, a method for generating accompaniment music is provided. The method includes:

[0007] Determine the target beat number of the initial music, where the target beat number is the number of beats per minute of the initial music;

[0008] Among the virtual musical instruments corresponding to at least two beat number ranges, determine the target virtual musical instrument corresponding to the beat number range where the target beat number is located;

[0009] During the playing of the initial music, receive at least two trigger commands for the target virtual musical instrument;

[0010] According to the reception times of the at least two trigger commands, combine the sounds of the target virtual musical instrument indicated by each of the at least two trigger commands to obtain accompaniment music.

[0011] On the other hand, an apparatus for generating accompaniment music is provided. The apparatus for generating accompaniment music includes:

[0012] The first determination module is configured to determine the target beat count of the initial music, where the target beat count is the beats per minute of the initial music;

[0013] The second determination module is configured to determine the target virtual instrument corresponding to the beat count range in which the target beat count is located among the virtual instruments corresponding to at least two beat count ranges;

[0014] The receiving module is configured to receive at least two trigger instructions for the target virtual instrument during the playback of the initial music;

[0015] The combining module is configured to combine the sounds of the target virtual instrument indicated by each of the at least two trigger instructions according to the reception times of the at least two trigger instructions to obtain the accompaniment music.

[0016] In another aspect, there is provided an apparatus for generating accompaniment music, the apparatus for generating accompaniment music including: a processor and a memory, where at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned method for generating accompaniment music.

[0017] In yet another aspect, there is provided a computer-readable storage medium, where at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the above-mentioned method for generating accompaniment music.

[0018] The beneficial effects brought by the technical solution provided in this application at least include:

[0019] In the method for generating accompaniment music of this application, the terminal can directly determine a more suitable target virtual instrument according to the target beat count of the initial music, and then the user only needs to trigger the target virtual instrument to obtain the accompaniment music; even if the user cannot perceive the tone style of the initial music and is not familiar with the playing styles and emotional expressions of various instruments, the user can still use a suitable virtual instrument to create accompaniment music for the initial music. Therefore, the threshold for creating accompaniment music is reduced, and the functions of the music software are effectively enriched. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a method for generating accompaniment music provided by an embodiment of this application;

[0021] Figure 2 is a flowchart of another method for generating accompaniment music provided by an embodiment of this application;

[0022] Figure 3It is a display interface diagram of a terminal provided by an embodiment of the present application;

[0023] Figure 4 It is a flowchart of a method for evaluating accompaniment music provided by an embodiment of the present application;

[0024] Figure 5 It is a schematic structural diagram of a device for generating accompaniment music provided by an embodiment of the present application;

[0025] Figure 6 It is a schematic structural diagram of another device for generating accompaniment music provided by an embodiment of the present application;

[0026] Figure 7 It is a schematic structural diagram of still another device for generating accompaniment music provided by an embodiment of the present application;

[0027] Figure 8 It is a schematic structural diagram of a terminal provided by an embodiment of the present application. Detailed implementation manners

[0028] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0029] Currently, computer software plays a great role in music creation. By using computer software, the sounds of physical musical instruments can be simulated, and thus music creators can complete music creation without spending a large amount of manpower and financial resources on playing physical musical instruments. However, the current music software related to music creation still has a relatively high usage threshold. Users need to have professional music knowledge to use the music software well, and the functions of the music software are also relatively few, making it difficult to meet the growing needs of users. The following embodiments of the present application provide a method and a device for generating accompaniment music. The music software can generate accompaniment music through the method for generating accompaniment music, which can simplify the process of generating accompaniment music, lower the usage threshold of the music software, and enrich the functions of the music software.

[0030] The method for generating accompaniment music provided by the embodiments of the present application can be implemented by a terminal, and the terminal includes at least one of terminals such as smart phones, tablet computers, portable laptop computers, desktop computers, smart speakers, and smart wearable devices.

[0031] Figure 1 It is a flowchart of a method for generating accompaniment music provided by an embodiment of the present application. This method can be used for a terminal, such as Figure 1 As shown, this method may include:

[0032] Step 101, determine the target beat count of the initial music, where the target beat count is the number of beats per minute of the initial music.

[0033] Step 102: Among the virtual instruments corresponding to at least two beat number ranges, determine the target virtual instrument corresponding to the beat number range where the target beat number is located.

[0034] Step 103: During the playback of the initial music, receive at least two trigger instructions for the target virtual instrument.

[0035] Step 104: According to the reception times of the at least two trigger instructions, combine the sounds of the target virtual instrument indicated by each trigger instruction in the at least two trigger instructions to obtain the accompaniment music.

[0036] A computer software related to music creation can be installed on the terminal. In the embodiments of the present application, this computer software related to music creation is simply referred to as music software. When this music software runs on the terminal, the terminal can implement the method for generating accompaniment music provided by the embodiments of the present application.

[0037] In summary, in the method for generating accompaniment music provided by the embodiments of the present application, the terminal can directly determine a more suitable target virtual instrument according to the target beat number of the initial music. Then, the user only needs to trigger the target virtual instrument to obtain the accompaniment music. Even if the user cannot perceive the tone style of the initial music and is not familiar with the playing styles and emotional expressions of various instruments, the user can also use a suitable virtual instrument to create accompaniment music for the initial music. Therefore, the threshold for creating accompaniment music is reduced, and the functions of the music software are effectively enriched.

[0038] Figure 2 It is a flowchart of another method for generating accompaniment music provided by the embodiments of the present application. This method can be used for a terminal, such as Figure 2 As shown, this method may include:

[0039] Step 201: Obtain the initial music.

[0040] A music software can be installed on the terminal. The user can operate on the terminal to trigger the terminal to run this music software. For example, an icon of the music software can be displayed on the display screen of the terminal, and the user can click on this icon to start the music software. In an alternative manner, this music software can read the music files stored in the terminal, and then the user can select a file from the music files read by this music software to obtain the initial music. In another alternative manner, the user can search for and download the file corresponding to the required initial music on the Internet through this music software. In another alternative manner, the user can start the recording function of the terminal through this music software, and the user can sing by himself / herself. Then, the terminal can determine the recorded music as the initial music.

[0041] Optionally, the initial music obtained by the terminal may include initial accompaniment music. For example, if the initial music is downloaded by searching on the Internet; the initial music may also not include any accompaniment music. For example, if the initial music is the a cappella music recorded by the user on the terminal.

[0042] Step 202: Use the music beat tracking method to obtain multiple beat points in the initial music, where the beat points indicate the starting moment of a beat in the initial music.

[0043] Exemplarily, the music beat tracking method may be a music beat tracking method based on dynamic programming, or a music beat tracking method based on frequency domain features, or a music beat tracking method based on deep learning.

[0044] The terminal may play the initial music, and then obtain multiple beat points in the initial music based on the music beat tracking method during the playback of the initial music. It should be noted that the starting moment of the beat during the playback of the initial music may be directly determined as the beat point, or the beat point may also be represented by the time difference between the starting moment of the beat and the starting playback moment of the initial music.

[0045] Step 203: Determine the interval duration between every two adjacent beat points among the multiple beat points to obtain multiple interval durations.

[0046] In the embodiment of the present application, the number of the multiple beat points may be greater than 2, that is, at least three beat points in the initial music may be obtained in step 202, so as to ensure that multiple interval durations can be obtained according to the multiple beat points. Exemplarily, the terminal may start from the second beat point and calculate the interval duration between each beat point and its previous beat point. For example, the interval duration is obtained by subtracting the moment indicated by the previous beat point from the moment indicated by each beat point, and then multiple interval durations are obtained according to the multiple beat points obtained. The unit of the interval duration may be seconds.

[0047] Step 204: Determine the interval duration with the most occurrences among the multiple interval durations as the beat duration of the initial music.

[0048] Since each beat point indicates the starting moment of a beat, the interval duration between two adjacent beat points may represent the duration of a beat, that is, how many seconds per beat. The beats of music are continuous and consistent, and the beats in a piece of music are basically the same. There will inevitably be a little error in the terminal's music beat tracking, which may lead to a deviation between some interval durations and the actual beat duration of the initial music. Therefore, the terminal may determine the interval duration with the most occurrences among the obtained multiple interval durations as the beat duration of the initial music, so as to ensure that the difference between the determined beat duration and the actual beat duration of the initial music is small and ensure the accuracy of the determined beat duration.

[0049] Step 205: Determine the target number of beats according to the beat duration using the first formula.

[0050] Among them, the target number of beats is the number of beats per minute of the initial music, and the unit of the number of beats per minute is BMP (English: beats per minute). The first formula is: M = 60 / T, where M represents the target number of beats and T represents the beat duration.

[0051] Step 206: Among the virtual instruments corresponding to multiple ranges of the number of beats, determine the target virtual instrument corresponding to the range of the number of beats where the target number of beats is located.

[0052] The number of beats of music is related to the speed of the music rhythm, and the speed of the music rhythm affects the style of the music. Since the accompanying music for different styles of music also needs to conform to that style, and the accompanying music obtained by playing different instruments can have different styles, the target virtual instrument that conforms to the style of the initial music can be determined according to the target number of beats of the initial music, so as to ensure that the accompanying music obtained by the target virtual instrument can conform to the style of the initial music.

[0053] In the embodiments of the present application, the speed of the music rhythm can be reflected by the number of beats of the music. For example, a music software can provide one or more virtual instruments corresponding to multiple ranges of the number of beats, and the music software can simulate the sounds of these virtual instruments. Each range of the number of beats in the multiple ranges of the number of beats can reflect a kind of music with a music rhythm. Exemplarily, the multiple ranges of the number of beats include a first range where the number of beats is greater than 100, a second range where the number of beats is between 60 and 100, and a third range where the number of beats is less than 60. The first range reflects fast music with a fast music rhythm, the second range reflects medium-speed music with a medium music rhythm, and the third range reflects slow music with a slow music rhythm.

[0054] Among them, the speed of the music rhythm is usually positively correlated with the intensity of the music rhythm, that is, the intensity of the music with a fast music rhythm is stronger, and the intensity of the music with a slow music rhythm is weaker. It should be noted that in practical applications, the speed of the music rhythm and the intensity of the music rhythm can also be negatively correlated, that is, the intensity of the music with a slow music rhythm is stronger, and the intensity of the music with a fast music rhythm is weaker. The correlation between the speed and intensity of the music rhythm can be set by the user or can also be a default setting, and can also be set in other ways. The subsequent embodiments will be described by taking the positive correlation between the speed and intensity of the music rhythm as an example, but this is not limited thereto.

[0055] Exemplarily, the accompanying music that conforms to this fast music style needs to meet the requirements of having a sharper timbre, a higher pitch, a louder volume, and an extremely short duration. For example, the tom drum with a relatively high pitch in a drum set can play the accompanying music that conforms to this music style, and the virtual instrument corresponding to the first range may include a virtual tom drum. The accompanying music that conforms to this medium-speed music style needs to meet the requirements of having a moderate timbre, a moderate volume, and a certain duration. For example, the snare drum with a medium-frequency timbre in a drum set can play the accompanying music that conforms to this music style, and the virtual instrument corresponding to the second range may include a virtual snare drum. The accompanying music that conforms to this slow music style needs to meet the requirements of having a deep timbre, a smaller volume, and a longer duration. For example, the bass drum with a low-frequency timbre in a drum set can play the accompanying music that conforms to this music style, and the virtual instrument corresponding to the third range may include a virtual bass drum.

[0056] Optionally, the first range, the second range, and the third range may also correspond to the same virtual instrument. For example, the accompanying music played by a djembe and a hand drum can conform to the styles of fast music, medium-speed music, and slow music at the same time, and the virtual instruments corresponding to the first range, the second range, and the third range may all include a virtual djembe and a virtual hand drum. Optionally, the first range, the second range, and the third range may also correspond to other virtual drums and other types of virtual instruments, such as a piano, a violin, a cello, or an erhu.

[0057] The tempo of music also has a certain impact on the psychological emotions of listeners. When the music is gentle and soothing, such as medium-speed music, it can give people a calm and stable mood; when the music tempo is extremely slow, such as slow music, it will stimulate people's imagination, compassion, and a sense of nostalgia, generating complex emotional reactions; when the music tempo speeds up, such as fast music, it will produce a positive and optimistic mood. Therefore, it is also possible to adjust the tempo of the music to change the impact effect of the music on the psychological emotions of listeners, or to determine the tempo of the accompanying music according to the desired impact effect on the listeners, and then determine the corresponding target virtual instrument. For example, if the user wants to create accompanying music for the initial music that can make people calm and stable, they can select a virtual instrument suitable for the medium-speed music style as the target virtual instrument.

[0058] It should be noted that in this embodiment of the application, only the example where the multiple beat number ranges include three ranges is used for illustration. Optionally, the multiple beat number ranges may also include only two ranges, or may include four ranges or even more ranges, and this embodiment of the application does not make any limitations in this regard. Optionally, the beat numbers in different beat number ranges are all different.

[0059] In an optional implementation, each beat count range among the multiple beat count ranges corresponds to multiple virtual instruments, and a default virtual instrument is included in each of the multiple virtual instruments corresponding to each beat count range. After determining the target beat count of the initial music, the terminal may determine the default virtual instrument among the multiple virtual instruments corresponding to the beat count range where the target beat count is located as the target virtual instrument. Optionally, the multiple virtual instruments corresponding to the beat count range where the target beat count is located may not include a default virtual instrument either. In this case, the terminal may determine any one of the multiple virtual instruments as the target virtual instrument. Alternatively, the terminal may also determine the virtual instrument with the most usage times among the multiple virtual instruments as the target virtual instrument.

[0060] Optionally, after determining the target virtual instrument according to the target beat count of the initial music, if the terminal receives a virtual instrument replacement instruction; further, the terminal may replace the target virtual instrument among the multiple virtual instruments corresponding to the beat count range where the target beat count is located according to the virtual instrument replacement instruction. For example, an instrument replacement control may be displayed on the terminal, and the user may trigger the instrument replacement control (such as clicking on the display position of the control) to trigger the terminal to receive the virtual instrument replacement instruction.

[0061] Exemplarily, after determining the target virtual instrument according to the target beat count of the initial music, the terminal may display an identifier of the target virtual instrument, and the identifier may be a character or a pattern, etc. For example, if the target virtual instrument is a virtual African drum, a pattern of an African drum may be displayed on the display screen of the terminal. The user may determine whether the target virtual instrument meets the requirements according to the identifier of the target virtual instrument. If the user does not want to create accompaniment music with the target virtual instrument, the user may click on the instrument replacement control displayed on the terminal to replace the target virtual instrument. Optionally, the terminal may sequentially replace the target virtual instrument among the multiple virtual instruments in a set order each time it receives a virtual instrument replacement instruction. Alternatively, the terminal may also display the identifiers of the multiple virtual instruments when it receives a virtual instrument replacement instruction; when the terminal detects a selection operation for one of the identifiers, it may determine the virtual instrument indicated by the identifier as the target virtual instrument.

[0062] Step 207: During the playback of the initial music, receive multiple trigger instructions for the target virtual instrument.

[0063] After determining the target virtual instrument, the terminal may play the initial music to facilitate the user to trigger the target virtual instrument to create accompaniment music following the initial music. Optionally, the terminal may play the initial music after receiving a playback instruction for the initial music, and then receive trigger instructions for the target virtual instrument.

[0064] Exemplarily, after determining the target virtual musical instrument, the terminal can display a prompt message to prompt the user that the appropriate virtual musical instrument has been determined and prompt the user whether to start playing the initial music and create the accompanying music. The terminal can also display a selection control for determining to play the initial music. When the user selects the selection control, the terminal can determine that it has received a play instruction for the initial music and then play the initial music. Optionally, the terminal can also display a trigger control for the target virtual musical instrument. The user can operate on the trigger control (such as performing a click operation), thereby triggering the target virtual musical instrument so that the terminal receives a trigger instruction for the target virtual musical instrument. Alternatively, the terminal may not display the trigger control for the target virtual musical instrument. The terminal can determine that it has received a trigger instruction for the target virtual musical instrument when detecting a touch operation on the target area of the display screen.

[0065] In the embodiments of the present application, each trigger instruction for the target virtual musical instrument can indicate a sound of the target virtual musical instrument. When the terminal receives each trigger instruction, it can obtain the sound of the target virtual musical instrument indicated by the trigger instruction. It should be noted that there can be multiple corresponding ways between the trigger instruction and the sound of the target virtual musical instrument it indicates. Here, three optional implementation manners are taken as examples for illustration.

[0066] In an optional implementation manner, the sounds of the target virtual musical instrument indicated by the respective trigger instructions for the target virtual musical instrument can be the same. Thus, if the target virtual musical instrument is triggered through the trigger control, the terminal can only display one trigger control for the target virtual musical instrument. It should be noted that the same sound of the target virtual musical instrument can mean that the sound intensity and pitch of the sound are the same.

[0067] In another optional implementation manner, multiple trigger controls can be set for different sounds (such as different sound intensities or pitches) that the target virtual musical instrument can emit. When the user triggers different trigger controls, the sounds of the target virtual musical instrument indicated by the trigger instructions received by the terminal are different. Alternatively, when the terminal detects touch operations on different target areas of the display screen, the sounds of the target virtual musical instrument indicated by the trigger instructions received by the terminal are different. Exemplarily, as Figure 3 shown, if the target virtual musical instrument is a piano, the terminal can display a virtual piano keyboard, and each virtual key in the virtual piano keyboard can be a trigger control. When the user triggers different trigger controls, the sounds indicated by the trigger instructions received by the terminal are different. Alternatively, each of these virtual keys can be regarded as a target area.

[0068] In another alternative implementation, the sound of the target virtual instrument indicated by the trigger instruction is related to the scale in the initial music. For example, the terminal can automatically determine the sound of the target virtual instrument indicated by the trigger instruction according to the scale in the initial music with the closest playback time to the reception time of the trigger instruction. The sound intensity and pitch of this sound can be positively correlated with the scale. For example, if the playback time of scale 2 is the closest to the reception time of trigger instruction a, and the playback time of scale 1 is the closest to the reception time of trigger instruction b, the sound intensity of the target virtual instrument indicated by trigger instruction a can be higher than that of the target virtual instrument indicated by trigger instruction b.

[0069] Optionally, when playing the target music, the terminal can also display a prompt message at each determined beat point to instruct the user to trigger the target virtual instrument according to the prompt message, so as to improve the accuracy of the moment when the user triggers the target virtual instrument and improve the matching degree between the generated accompaniment music and the initial music.

[0070] Step 208: According to the reception times of the multiple trigger instructions, combine the sounds of the target virtual instruments indicated by each trigger instruction in the multiple trigger instructions to obtain accompaniment music.

[0071] After the initial music is played, the terminal can determine all the trigger instructions received during the playback of the initial music, the reception time of each trigger instruction, and the sound of the target virtual instrument indicated by each trigger instruction. The terminal can combine the sounds of the target virtual instruments indicated by each trigger instruction according to the reception times of the respective trigger instructions, and then obtain the accompaniment music. For example, the time difference between the reception times of two adjacent trigger instructions is determined as the start playback time difference of the sounds of the target virtual instruments indicated by these two trigger instructions in the accompaniment music.

[0072] Optionally, after generating the accompaniment music, the terminal can save the accompaniment music as a separate music file. In this way, the terminal can play the accompaniment music separately.

[0073] Step 209: Mix the initial music and the accompaniment music to obtain the target music.

[0074] The terminal can mix the initial music and the accompaniment music according to the relationship between the reception times of the respective trigger instructions and the playback times of each part in the initial music, and then obtain the target music, thus realizing the matching of accompaniment music for the initial music. Optionally, if the initial music already includes accompaniment music, the terminal can also directly superimpose the accompaniment music generated in step 208 on the initial music to add another accompaniment for the initial music.

[0075] Optionally, the terminal can save the target music as a separate music file.

[0076] Step 210: Play the target music.

[0077] After generating the target music, the terminal can directly play the target music for the user to determine the effect of the accompanying music for the initial music based on the target music. Alternatively, the terminal can also play the target music after receiving the play instruction of the target music triggered by the user.

[0078] Optionally, after obtaining the target music in step 209, the terminal can directly save the target music, such as saving the target music as a separate music file. Alternatively, the terminal can also save the target music after detecting the save instruction of the user after playing the target music in step 210.

[0079] In an optional embodiment of the present application, the terminal can also evaluate the generated accompanying music. For example, the terminal can also determine the matching degree between the accompanying music and the initial music according to the reception time of the multiple trigger instructions and the multiple beat points in the initial music, and the matching degree is negatively correlated with the absolute value of the time difference between the reception time of the trigger instruction and the nearest beat point. Furthermore, the terminal can display the matching degree to the user, and the user can know the accuracy of the accompanying music and the effect of matching the accompanying music for the initial music according to the matching degree. Exemplarily, Figure 4 is a flowchart of a method for evaluating accompanying music provided by an embodiment of the present application. As Figure 4 shown, the terminal can determine the matching degree between the accompanying music and the initial music through the following steps 301 to 304 and display the matching degree.

[0080] Step 301: Determine the target beat points among the multiple beat points of the initial music whose interval duration with the subsequent beat point is within the target duration interval.

[0081] Among them, the target duration interval includes [T / 2 - a, T / 2 + a], [T - a, T + a] and [2T - a, 2T + a], and a is the target duration threshold. Optionally, a = 0.03 seconds.

[0082] Exemplarily, in step 202, the terminal can obtain m beat points, m > 2, and in step 203, the terminal can obtain m - 1 interval durations. The terminal can screen the multiple interval durations obtained in step 203 in sequence from the first interval duration according to the target duration threshold. If a certain interval duration (such as the i-th interval duration) is not within the target duration interval, the terminal can delete the i-th beat point among the m beat points obtained in step 202. In this way, the remaining beat points among the m beat points after screening the m - 1 interval duration points are the target beat points.

[0083] It should be noted that it is difficult to obtain all the beat points of the initial music completely and accurately by using the music beat tracking method. In the embodiments of the present application, through step 301, multiple beat points obtained by the music beat tracking method are secondarily screened to obtain multiple relatively accurate target beat points. Since a beat point indicates the start time of a beat, if two adjacent beat points determined are accurate, the time interval between the two beat points should be equal to the beat duration of the initial music. Therefore, the terminal can determine whether the beat point corresponding to the time interval is accurate through step 301 according to whether the time interval is within the error range of the beat duration. The beat point corresponding to the time interval is the previous beat point of the two adjacent beat points that constitute the time interval, and the difference between the time interval within the error range of the beat duration and the beat duration is less than the target duration threshold. Since in music, a unit time period of music can also be represented by a half beat or two beats, it is also possible to determine whether the beat point corresponding to the time interval is accurate according to whether the time interval between two adjacent beat points is within the error range of half or twice the beat duration. When the time interval between two adjacent beat points is within the error range of the beat duration, or within the error range of half of the beat duration, or within the error range of twice the beat duration, it can be determined that the beat point corresponding to the time interval is accurate; otherwise, it is determined that the beat point is inaccurate, and then the beat point is deleted.

[0084] In the embodiments of the present application, step 301 can be executed after step 205. Optionally, step 301 can be executed before step 207. In this way, in step 207, when the terminal plays the target music, a prompt message can be displayed at each determined target beat point to instruct the user to trigger the target virtual instrument according to the prompt message.

[0085] Step 302: Determine the accuracy rate of each trigger instruction among the multiple trigger instructions.

[0086] Among them, the accuracy rate of each trigger instruction is negatively correlated with the absolute value of the time difference between the reception time of each trigger instruction and the time of the nearest target beat point.

[0087] Exemplarily, when the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is less than or equal to the first duration threshold, the terminal can determine that the accuracy rate of the trigger instruction is 1.

[0088] When the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is greater than or equal to the second duration threshold, the terminal can determine that the accuracy rate of the trigger instruction is 0, and the first duration threshold is less than the second duration threshold.

[0089] When the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is between the first duration threshold and the second duration threshold, the terminal can determine the accuracy rate of the trigger instruction according to the second formula. The second formula is: Where S represents the accuracy rate of the trigger instruction, x represents the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point, t1 represents the first duration threshold, and t2 represents the second duration threshold.

[0090] Optionally, t1 = 0.15 seconds and t2 = 1 second. It should be noted that t1 and t2 can also be other values, or can be defined by the user. For example, t1 can be 0.13 seconds and t2 can be 0.98 seconds. The embodiments of the present application do not make limitations. It should be noted that when the absolute value of this time difference is between the first duration threshold and the second duration threshold, the accuracy rate of the trigger instruction and the absolute value of this time difference can satisfy a linear function. The graph of this linear function is a straight line passing through the two points (0.15, 1) and (1, 0). According to the coordinates of these two points, the expression of this linear function can be obtained as This expression is also the second formula.

[0091] In the embodiments of the present application, step 302 can be executed after step 207.

[0092] Step 303: Determine the matching degree between the accompaniment music and the initial music according to the accuracy rates of the multiple trigger instructions.

[0093] It should be noted that the matching degree between the accompaniment music and the initial music is positively correlated with the accuracy rate of the trigger instruction. For example, the terminal can determine the average value of the accuracy rates of the multiple trigger instructions as the matching degree between the accompaniment music and the initial music. Optionally, each trigger instruction can also have a corresponding weight, and this matching degree can also be the weighted average value of the accuracy rates of the multiple trigger instructions.

[0094] Step 304: Display the matching degree between the accompaniment music and the initial music.

[0095] For example, the matching degree between the accompaniment music and the initial music can be a percentage. After determining this matching degree, the terminal can directly display this percentage on the display screen. Or the terminal can also directly display this percentage on the display screen when playing the target music.

[0096] Optionally, when playing the target music, the terminal can also display the first pattern at the playback moment of each sound indicated by the trigger instruction in the accompaniment music, and display the second pattern at the playback moment of each sound at the target beat point in the initial music. In this way, the user can determine the degree of fit between each beat point in the accompaniment music and the beat points in the initial music according to the difference in the display moments of the first pattern and the second pattern on the display screen.

[0097] The method for generating accompaniment music provided by the embodiments of the present application can be used in an intelligent music composition scenario for interacting with users. For example, when a user is learning a certain musical instrument (such as African drums or hand drums) but their basic music knowledge needs to be improved, this method can be used to play music accompaniment with a virtual instrument through a terminal. In addition, a music software that supports this method for generating accompaniment music can be used as a tool for users who are beginners in music to learn and practice musical instruments. Users can evaluate the effect of the accompaniment music they create by the matching degree between the obtained accompaniment music and the initial music, and thus can assist users in learning and practicing musical instruments and improving their music level. Optionally, this method can also be used for music drumming in an arcade. For example, a music drumming machine can output the matching degree between the user's drumming sound and the music after the user drums. So as to facilitate the user to evaluate their drumming effect. The method of the present application can also be used for re-creating and adapting music and converting music styles.

[0098] In summary, in the method for generating accompaniment music provided by the embodiments of the present application, the terminal can directly determine a relatively suitable target virtual instrument according to the target beat number of the initial music. Then, the user only needs to trigger the target virtual instrument to obtain the accompaniment music. Even if the user cannot perceive the tone style of the initial music and is not familiar with the playing styles and emotional expressions of various musical instruments, they can still use a suitable virtual instrument to create accompaniment music for the initial music. Therefore, the threshold for creating accompaniment music is reduced, and the functions of the music software are effectively enriched.

[0099] Figure 5 It is a schematic structural diagram of an apparatus for generating accompaniment music provided by the embodiments of the present application. As Figure 5 shown, the apparatus 40 for generating accompaniment music may include:

[0100] A first determination module 401, configured to determine the target beat number of the initial music, where the target beat number is the number of beats per minute of the initial music.

[0101] A second determination module 402, configured to determine the target virtual instrument corresponding to the beat number range where the target beat number is located among the virtual instruments corresponding to at least two beat number ranges.

[0102] A receiving module 403, configured to receive at least two trigger instructions for the target virtual instrument during the playback of the initial music.

[0103] A combining module 404, configured to combine the sounds of the target virtual instrument indicated by each of the at least two trigger instructions according to the reception time of the at least two trigger instructions to obtain the accompaniment music.

[0104] In summary, in the accompaniment music generation device provided by the embodiments of the present application, the terminal can directly determine a relatively suitable target virtual instrument according to the target beat number of the initial music. Then, the user only needs to trigger the target virtual instrument to obtain the accompaniment music. Even if the user cannot perceive the tone style of the initial music and is not familiar with the playing styles and emotional expression methods of various instruments, they can still use a suitable virtual instrument to create accompaniment music for the initial music. Therefore, the threshold for creating accompaniment music is reduced, and the functions of the music software are effectively enriched.

[0105] Optionally, each beat number range in the at least two beat number ranges corresponds to at least two virtual instruments, and the at least two virtual instruments corresponding to each beat number range include a default virtual instrument. The second determination module 402 is further configured to: determine the default virtual instrument among the at least two virtual instruments corresponding to the beat number range where the target beat number is located as the target virtual instrument.

[0106] Optionally, the first determination module 401 is further configured to:

[0107] Adopt the music beat tracking method to obtain at least three beat points in the initial music, where the beat point indicates the starting moment of a beat in the initial music;

[0108] Determine the interval duration between every two adjacent beat points among the at least three beat points to obtain at least two interval durations;

[0109] Determine the interval duration that appears the most times among the at least two interval durations as the beat duration of the initial music;

[0110] According to the beat duration, determine the target beat number using the first formula. The first formula is: M = 60 / T, where M represents the target beat number and T represents the beat duration.

[0111] Optionally, Figure 6 is a schematic structural diagram of another accompaniment music generation device provided by the embodiments of the present application. As Figure 6 shown, on the basis of Figure 5 this, the accompaniment music generation device 40 may further include:

[0112] A third determination module 405, configured to determine the matching degree between the accompaniment music and the initial music according to the reception times of at least two trigger instructions and at least three beat points in the initial music. The matching degree is negatively correlated with the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest beat point.

[0113] A display module 406, configured to display the matching degree.

[0114] Optionally, the third determination module 405 is further configured to:

[0115] Determine a target beat point among the at least three beat points, where the interval duration from the target beat point to the subsequent beat point is within a target duration range, and the target duration range includes [T / 2 - a, T / 2 + a], [T - a, T + a], and [2T - a, 2T + a], and a is a target duration threshold;

[0116] Determine the accuracy rate of each of the at least two trigger commands, where the accuracy rate of each trigger command is negatively correlated with the absolute value of the time difference between the reception time of each trigger command and the time of the nearest target beat point;

[0117] Determine the average value of the accuracy rates of the at least two trigger commands as the matching degree between the accompaniment music and the initial music.

[0118] Optionally, the third determination module 405 is further configured to:

[0119] When the absolute value of the time difference between the reception time of the trigger command and the time of the nearest target beat point is less than or equal to a first duration threshold, determine that the accuracy rate of the trigger command is 1;

[0120] When the absolute value of the time difference between the reception time of the trigger command and the time of the nearest target beat point is greater than or equal to a second duration threshold, determine that the accuracy rate of the trigger command is 0, where the first duration threshold is less than the second duration threshold;

[0121] When the absolute value of the time difference between the reception time of the trigger command and the time of the nearest target beat point is between the first duration threshold and the second duration threshold, determine the accuracy rate of the trigger command according to the second formula, and the second formula is: where S represents the accuracy rate of the trigger command, x represents the absolute value of the time difference between the reception time of the trigger command and the time of the nearest target beat point, t1 represents the first duration threshold, and t2 represents the second duration threshold.

[0122] Optionally, Figure 7 is a schematic structural diagram of another accompaniment music generation device provided by an embodiment of the present application. As Figure 7 shown, on the basis of Figure 5 the accompaniment music generation device 40 may further include:

[0123] A mixing module 407, configured to mix the initial music and the accompaniment music to obtain target music;

[0124] A playing module 408, configured to play the target music.

[0125] In summary, in the accompaniment music generating device provided by the embodiments of the present application, the terminal can directly determine a more suitable target virtual instrument according to the target beat number of the initial music, and then the user only needs to trigger the target virtual instrument to obtain the accompaniment music; even if the user cannot perceive the tone style of the initial music and is not familiar with the playing styles and emotional expressions of various instruments, they can still use a suitable virtual instrument to create accompaniment music for the initial music, thus reducing the threshold for creating accompaniment music and effectively enriching the functions of the music software.

[0126] Figure 8 It is a schematic structural diagram of a terminal provided by an embodiment of the present application. The terminal may include the accompaniment music generating device in the above embodiment, such as Figure 8 shown, the terminal 90 may be a portable mobile terminal, such as: a smart phone, a tablet computer, a laptop computer or a desktop computer. The terminal 90 may also be referred to by other names such as a user terminal, a portable terminal, a laptop terminal, a desktop terminal, etc. Generally, the terminal 90 includes: a processor 901 and a memory 902.

[0127] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0128] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 902 is used to store at least one instruction for being executed by the processor 901 to implement the method provided in the method embodiments of this application.

[0129] In some embodiments, the terminal 90 may further optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902, and the peripheral device interface 903 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 903 through a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 904, a touch display screen 905, a camera 906, an audio circuit 907, or a power supply 909.

[0130] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, and this embodiment does not limit this.

[0131] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 904 may communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.

[0132] The display screen 905 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 905, which is provided on the front panel of the terminal 90; in other embodiments, there may be at least two display screens 905, which are respectively provided on different surfaces of the terminal 90 or are in a foldable design; in still other embodiments, the display screen 905 may be a flexible display screen, which is provided on the curved surface or the folding surface of the terminal 90. Even, the display screen 905 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 905 can be prepared from materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0133] The camera module 906 is used to capture images or videos. Optionally, the camera module 906 includes a front camera and a rear camera. Generally, the front camera is provided on the front panel of the terminal, and the rear camera is provided on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the function of background blurring by fusing the main camera and the depth-of-field camera, the function of panoramic shooting by fusing the main camera and the wide-angle camera, and the VR (Virtual Reality) shooting function or other fused shooting functions. In some embodiments, the camera module 906 may also include a flash. The flash can be a single-color temperature flash or a two-color temperature flash. The two-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0134] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 901 for processing, or input to the radio frequency circuit 904 to enable voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 90. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 907 may further include a headphone jack.

[0135] The power supply 909 is used to supply power to each component in the terminal 90. The power supply 909 may be alternating current, direct current, a primary battery or a rechargeable battery. When the power supply 909 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0136] In some embodiments, the terminal 90 further includes one or more sensors 910. The one or more sensors 910 include but are not limited to: an acceleration sensor 911, a gyroscope sensor 912, a pressure sensor 913, an optical sensor 915, and a proximity sensor 916.

[0137] The acceleration sensor 911 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the terminal 90. For example, the acceleration sensor 911 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 901 can control the touch display screen 905 to display the user page in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 can also be used for the collection of game or user's motion data.

[0138] The gyroscope sensor 912 can detect the body direction and rotation angle of the terminal 90. The gyroscope sensor 912 can cooperate with the acceleration sensor 911 to collect the 3D actions of the user on the terminal 90. According to the data collected by the gyroscope sensor 912, the processor 901 can achieve the following functions: motion sensing (such as changing the UI according to the user's tilting operation), image stabilization during shooting, game control, and inertial navigation.

[0139] The pressure sensor 913 can be disposed on the side frame of the terminal 90 and / or the lower layer of the touch display screen 905. When the pressure sensor 913 is disposed on the side frame of the terminal 90, it can detect the holding signal of the user on the terminal 90, and the processor 901 can perform left / right hand recognition or quick operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is disposed on the lower layer of the touch display screen 905, the processor 901 can control the operable controls on the UI page according to the pressure operation of the user on the touch display screen 905. The operable controls include at least one of a button control, a scroll bar control, an icon control, or a menu control.

[0140] The optical sensor 915 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the touch display screen 905 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera module 906 according to the ambient light intensity collected by the optical sensor 915.

[0141] The proximity sensor 916, also known as a distance sensor, is usually disposed on the front panel of the terminal 90. The proximity sensor 916 is used to collect the distance between the user and the front of the terminal 90. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front of the terminal 90 is gradually decreasing, the processor 901 controls the touch display screen 905 to switch from the lit screen state to the off-screen state; when the proximity sensor 916 detects that the distance between the user and the front of the terminal 90 is gradually increasing, the processor 901 controls the touch display screen 905 to switch from the off-screen state to the lit screen state.

[0142] It should be understood that Figure 8 the structure shown in does not limit the terminal 90, and it may include more or fewer components than shown in the figure, or combine some components, or adopt different component arrangements.

[0143] In an exemplary embodiment, a computer-readable storage medium is further provided. At least one instruction, at least one segment of program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one segment of program, the code set or the instruction set is loaded and executed by a processor to perform any one of the above-described methods for generating accompaniment music. Optionally, the computer-readable storage medium may include: a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a solid state drive (SSD, Solid State Drives), or an optical disc, etc. Among them, the random access memory may include a resistive random access memory (ReRAM, Resistance Random Access Memory) and a dynamic random access memory (DRAM, Dynamic Random Access Memory).

[0144] An embodiment of the present application further provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the method for generating accompaniment music as described in any one of the above embodiments of the present application.

[0145] In the embodiments of the present application, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. The term "a plurality" means at least two, that is, two or more, unless otherwise clearly defined. The term "and / or" in the embodiments of the present application is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after. " / " is used as an operator representing "divided by" in formulas or mathematical operations. The term "at least one of A and B" in the present application is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, at least one of A and B may represent: A exists alone, A and B exist simultaneously, and B exists alone.

[0146] It should be noted that when the above-described apparatus for generating accompaniment music generates accompaniment music, only the above-described division of each functional module is used for illustration. In actual applications, the above functions may be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0147] It should be noted that: The method embodiments provided in the embodiments of the present application can be referred to in conjunction with the corresponding device embodiments, and the embodiments of the present application do not make any limitations in this regard. The order of the steps of the method embodiments provided in the embodiments of the present application can be appropriately adjusted, and the steps can also be increased or decreased accordingly according to the situation. Any person skilled in the art within the technical scope disclosed in the present application can easily think of a changed method, which should be covered within the protection scope of the present application, and thus will not be elaborated herein.

[0148] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for generating accompaniment music, characterized in that, The method includes: Determining the target beat count of the initial music, where the target beat count is the beats per minute of the initial music; Determining, among the virtual instruments corresponding to at least two beat count ranges, the target virtual instrument corresponding to the beat count range in which the target beat count is located; During the playback of the initial music, receiving at least two trigger instructions for the target virtual instrument; Combining the sounds of the target virtual instrument indicated by each of the at least two trigger instructions according to the reception times of the at least two trigger instructions to obtain an accompaniment music; Determining the matching degree between the accompaniment music and the initial music according to the reception times of the at least two trigger instructions and at least three beat points in the initial music, where the matching degree is negatively correlated with the absolute value of the time difference between the reception time of the trigger instruction and the nearest beat point among the at least three beat points, and the at least three beat points are obtained by using a music beat tracking method, and the beat point indicates the starting moment of a beat in the initial music.

2. The method according to claim 1, characterized in that, Each of the at least two beat count ranges corresponds to at least two virtual instruments, and the at least two virtual instruments corresponding to each beat count range include a default virtual instrument; The determining, among the virtual instruments corresponding to at least two beat count ranges, the target virtual instrument corresponding to the beat count range in which the target beat count is located includes: Determining the default virtual instrument among the at least two virtual instruments corresponding to the beat count range in which the target beat count is located as the target virtual instrument.

3. The method according to claim 1, wherein The determining the target beat count of the initial music includes: Determining the interval duration between every two adjacent beat points among the at least three beat points to obtain at least two interval durations; Determining the interval duration that appears most frequently among the at least two interval durations as the beat duration of the initial music; Determining the target beat count according to the beat duration by using a first formula, where the first formula is: M = 60 / T, where M represents the target beat count and T represents the beat duration.

4. The method according to claim 1, wherein The method further includes: Displaying the matching degree.

5. The method according to claim 1, characterized in that The determining the matching degree between the accompaniment music and the initial music according to the reception times of the at least two trigger instructions and at least three beat points in the initial music includes: Determining a target beat point among the at least three beat points whose interval duration with the subsequent beat point is within a target duration interval, where the target duration interval includes [T / 2 - a, T / 2 + a], [T - a, T + a], and [2T - a, 2T + a], and a is a target duration threshold; Determining the accuracy rate of each of the at least two trigger instructions, where the accuracy rate of each trigger instruction is negatively correlated with the absolute value of the time difference between the reception time of each trigger instruction and the nearest target beat point; Determining the average value of the accuracy rates of the at least two trigger instructions as the matching degree between the accompaniment music and the initial music.

6. The method according to claim 5, wherein The determining the accuracy rate of each of the at least two trigger instructions includes: When the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is less than or equal to the first duration threshold, determine that the accuracy rate of the trigger instruction is 1; When the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is greater than or equal to the second duration threshold, determine that the accuracy rate of the trigger instruction is 0, and the first duration threshold is less than the second duration threshold; When the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is between the first duration threshold and the second duration threshold, determine the accuracy rate of the trigger instruction according to the second formula, and the second formula is: Wherein, S represents the accuracy rate of the trigger instruction, x represents the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point, t1 represents the first duration threshold, and t2 represents the second duration threshold.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Mix the initial music and the accompaniment music to obtain the target music; Play the target music.

8. An apparatus for generating accompaniment music, characterized in that, The generating device of the accompaniment music includes: A first determination module, configured to determine the target beat number of the initial music, where the target beat number is the number of beats per minute of the initial music; A second determination module, configured to determine the target virtual instrument corresponding to the beat number range where the target beat number is located among the virtual instruments corresponding to at least two beat number ranges; A receiving module, configured to receive at least two trigger instructions for the target virtual instrument during the playback of the initial music; A combining module, configured to combine the sounds of the target virtual instrument indicated by each of the at least two trigger instructions according to the reception times of the at least two trigger instructions to obtain the accompaniment music; A third determination module, configured to determine the matching degree between the accompaniment music and the initial music according to the reception times of the at least two trigger instructions and at least three beat points in the initial music, where the matching degree is negatively correlated with the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest beat point among the at least three beat points, and the at least three beat points are obtained by using a music beat tracking method, and the beat point indicates the starting moment of a beat in the initial music.

9. The device according to claim 8, characterized in that, Each of the at least two beat number ranges corresponds to at least two virtual instruments, and the at least two virtual instruments corresponding to each beat number range include a default virtual instrument; the second determination module is configured to determine the default virtual instrument among the at least two virtual instruments corresponding to the beat number range where the target beat number is located as the target virtual instrument.

10. The device according to claim 8, wherein The first determination module is configured to determine the interval duration between every two adjacent beat points among the at least three beat points to obtain at least two interval durations; Determine the interval duration with the most occurrences among the at least two interval durations as the beat duration of the initial music; determine the target beat number according to the beat duration by using the first formula, where the first formula is: M = 60 / T, where M represents the target beat number and T represents the beat duration.

11. The device according to claim 8, characterized in that, The device further includes: A display module, configured to display the matching degree.

12. The device according to claim 8, characterized in that The third determination module is configured to determine the target beat points among the at least three beat points whose interval duration with the subsequent beat point is within a target duration interval, where the target duration interval includes [T / 2 - a, T / 2 + a], [T - a, T + a], and [2T - a, 2T + a], and a is the target duration threshold; Determine the accuracy rate of each of the at least two trigger instructions, where the accuracy rate of each trigger instruction is negatively correlated with the absolute value of the time difference between the reception time of each trigger instruction and the time of the nearest target beat point; determine the average value of the accuracy rates of the at least two trigger instructions as the matching degree between the accompaniment music and the initial music.

13. The device according to claim 12, wherein, The third determination module is configured to determine that the accuracy rate of the trigger instruction is 1 when the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is less than or equal to a first duration threshold; determine that the accuracy rate of the trigger instruction is 0 when the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is greater than or equal to a second duration threshold, where the first duration threshold is less than the second duration threshold; and when the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point is between the first duration threshold and the second duration threshold, determine the accuracy rate of the trigger instruction according to a second formula, and the second formula is: where S represents the accuracy rate of the trigger instruction, x represents the absolute value of the time difference between the reception time of the trigger instruction and the time of the nearest target beat point, t1 represents the first duration threshold, and t2 represents the second duration threshold.

14. The device according to any one of claims 8 to 13, characterized in that, The apparatus further includes: A mixing module, configured to mix the initial music and the accompaniment music to obtain target music; A playing module, configured to play the target music.

15. An apparatus for generating accompaniment music, characterized in that, The apparatus for generating the accompaniment music includes: a processor and a memory, where at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for generating the accompaniment music according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that, At least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for generating the accompaniment music according to any one of claims 1 to 7.

17. A computer program product, characterized in that, When the computer program product runs on a computer, the computer is caused to execute the method for generating the accompaniment music according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • System and method for generating a rhythmic accompaniment for a musical performance

    US20150013527A1