Methods, media, devices, and computing equipment for composing song melodies
By extracting music theory information and melodic features from songs in the music library, original song melodies that conform to the target style are generated, solving the problem of insufficient user-specified style datasets and achieving accuracy and harmony in song melodies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, there are few music datasets with user-specified styles, resulting in poor quality of generated music works and reduced user experience.
By extracting music theory information of the target song and melodic features of songs of the same style from the music library, the melody of the original song is generated. This includes splitting the chord sequence, extracting the first accent and the melodic envelope of the musical form, and adjusting dissonant notes to match the target style.
The generated original song melodies accurately match the style of the target song, enhancing the user experience.
Smart Images

Figure CN115631736B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure relate to the field of artificial intelligence, and more specifically, the embodiments of this disclosure relate to a method, medium, apparatus, and computing device for creating song melodies. Background Technology
[0002] This section is intended to provide background or context for embodiments of this disclosure. The description herein is not intended to imply that it is prior art simply because it is included in this section.
[0003] With the rapid development of artificial intelligence technology, in the field of music creation, AI technology can learn the characteristics of a large amount of music data on its own and generate musical works based on this.
[0004] Based on user needs, musical works are categorized into various styles, and users specify the style for the generated music. Therefore, it's necessary to classify the music data according to style, selecting user-specified style music data as learning objects, and then learning the characteristics of this music data to generate musical works. However, selecting user-specified style music data significantly reduces the number of learning objects, thus affecting the quality of the generated music and degrading the user experience. Summary of the Invention
[0005] This disclosure provides a method, medium, apparatus, and computing device for creating song melodies, used to generate song melodies that accurately conform to the style of a target song.
[0006] In a first aspect of this disclosure, a method for creating a song melody is provided, comprising: selecting a target song from a song library; determining songs of the same style as the target song from the song library; and generating a melody for the song based on the music theory information of the target song and the melodic characteristics of the songs of the same style.
[0007] In one embodiment of this disclosure, the method further includes: annotating the songs in the music library with music theory information; wherein the music theory information includes at least one of the following: beat, musical form, mode, chords, melody pitch, melody rhythm pattern, and musical phrase; extracting the melody features of the songs in the music library based on the music theory information; wherein the melody features of the songs in the music library include at least one of the following: chord segments, phrase-initial accent, phrase-final accent, melody rhythm pattern, and musical form melody envelope.
[0008] In another embodiment of this disclosure, the step of extracting the melodic features of the songs in the music library based on the music theory information of the songs in the music library includes: splitting the chord sequence of the songs in the music library according to the musical form structure of the songs in the music library to obtain multiple chord segments, wherein the chord segments are labeled with the mode, melodic rhythm pattern, measure length and melodic time signature.
[0009] In another embodiment of this disclosure, the step of extracting the melody features of the songs in the music library based on the music theory information of the songs in the music library includes: extracting the first accented note of each musical phrase and the last note of each musical phrase; and extracting the chord degree of the first accented note of the songs in the music library by comparing the chord fragments and the first accented note of the songs in the music library.
[0010] In another embodiment of this disclosure, the step of extracting the melodic features of the songs in the music library based on the music theory information of the songs in the music library includes: determining the musical structure to which each musical phrase of the songs in the music library belongs based on the start time of the musical phrase and the start time of the musical structure of the songs in the music library; taking the range of melodic pitches corresponding to each musical phrase of the songs in the music library as the range of the musical structure to which the musical phrase belongs; and forming the musical melody envelope of the songs in the music library based on the range of all musical structures contained in each song in the music library.
[0011] In another embodiment of this disclosure, generating the melody of the original song based on the music theory information of the target song and the melodic features of the songs of the same style includes: selecting chord segments from the chord segments of the songs of the same style that satisfy at least one of the following conditions to form a chord sequence for the melody of the original song; the conditions include: the mode of the chord segments is the same as the mode of the target song, the measure length of the target song is a positive integer multiple of the measure length of the chord segments, and the time signature of the melody of the chord segments is the same as the time signature of the melody of the target song; Based on the musical structure of the songs of the same style, select songs of the same style with the same musical structure as the target song, and extract the musical envelope of the target song as the musical envelope of the original song melody. Within the preset interval threshold and the range of the musical envelope of the original song melody, the phrase ending notes of the target song are adapted to the chord sequence of the original song melody to generate the phrase ending notes of the original song melody. Starting from the phrase ending notes of the original song melody, while keeping the melodic rhythm of the chord sequence unchanged, the original song melody is generated in reverse.
[0012] In yet another embodiment of this disclosure, the method further includes harmonizing the dissonant notes of the melody of the composed song.
[0013] In another embodiment of this disclosure, the harmonization process for the dissonant notes of the original melody includes: for the last note of the original melody, if its chord is a tonic chord, then the last note of the original melody is adjusted to the tonic of the mode; if the last note of the original melody belongs to a non-tonic chord, then the last note of the original melody is adjusted to the note corresponding to the chord degree closest to its interval; for non-terminal notes of the original melody, the following harmonization process is performed: the first harmonic note in the original melody that is on a strong beat and has a duration greater than a first duration is adjusted to the chord degree closest to its interval in the target song. The chord tone with the highest probability of being the stressed chord tone at the beginning of a phrase under a particular style; for the second harmonic note in the melody of the aforementioned song that is not on a strong beat and has a duration greater than the second duration, if it does not belong to a chord tone, then the second harmonic note is adjusted to the note corresponding to the chord tone closest to its interval; for all third harmonic notes that are not in the above situation, if the third harmonic note belongs to a chord tone, then no adjustment is made; if the third harmonic note does not belong to a chord tone, then it is determined whether the third harmonic note is a modal note; if the third harmonic note is a modal note, then no adjustment is made; if the third harmonic note is an unmodal note, then the third harmonic note is adjusted to the modal note closest to its interval.
[0014] In another embodiment of this disclosure, the method further includes: the first time value is greater than 0 beats and does not exceed 1 beat; the second time value is greater than the first time value.
[0015] In another embodiment of this disclosure, the method further includes: calculating the ratio of the number of times each chord degree of the first accent of a phrase appears to the total number of times all chord degrees of the first accent of a phrase appear in songs of each style, to obtain the probability of each chord degree of the first accent of a phrase in each style.
[0016] In a second aspect of the present disclosure, a computer-readable storage medium is provided, comprising: computer-executable instructions stored therein, which, when executed by a processor, are used to implement the song melody creation method as described in any one of the first aspects.
[0017] In a third aspect of this disclosure, a song melody creation apparatus is provided, comprising: a selection module for selecting a target song from a song library; a determination module for determining songs of the same style as the target song from the song library; and a creation module for generating a song melody based on music theory information of the target song and melodic features of the songs of the same style.
[0018] In one embodiment of this disclosure, the apparatus further includes: an annotation module for annotating the songs in the music library with music theory information; wherein the music theory information includes at least one of the following: beat, musical form, mode, chord, melody pitch, melody rhythm pattern, and musical phrase; and an extraction module for extracting the melody features of the songs in the music library based on the music theory information; wherein the melody features of the songs in the music library include at least one of the following: chord segments, phrase-initial accent, phrase-final accent, melody rhythm pattern, and musical form melody envelope.
[0019] In another embodiment of this disclosure, the extraction module is specifically used to split the chord sequence of the songs in the music library according to the musical structure of the songs in the music library to obtain multiple chord segments, wherein the chord segments are labeled with the key, melodic rhythm pattern, measure length and melodic time signature.
[0020] In another embodiment of this disclosure, the extraction module is specifically used to extract the first accented note of each musical phrase and the last note of each musical phrase; the extraction module is also specifically used to extract the chord degree of the first accented note of the musical phrase by comparing it with the chord fragments and the first accented note of the songs in the music library.
[0021] In another embodiment of this disclosure, the extraction module is specifically used to determine the musical form of each phrase in the music library songs based on the start time of the phrase and the start time of the musical form of the music library songs; the extraction module is further used to take the range of melodic pitch corresponding to each phrase in the music library songs as the range of the musical form to which the phrase belongs; the extraction module is further used to form the musical form envelope of the music library songs based on the range of all musical forms contained in each music library song.
[0022] In another embodiment of this disclosure, the device further includes: a creation module, configured to select chord segments from the chord segments of the same style songs that satisfy at least one of the following conditions to form a chord sequence for the melody of the created song; the conditions include: the mode of the chord segments is consistent with the mode of the target song, the measure length of the target song is a positive integer multiple of the measure length of the chord segments, and the time signature of the melody of the chord segments is consistent with the time signature of the melody of the target song; the creation module is further configured to select songs of the same style with the same musical structure as the target song according to the musical structure of the same style songs, and extract the musical form melody envelope from them as the musical form melody envelope of the created song melody; the creation module is further configured to generate the phrase ending note of the created song melody by adapting the phrase ending note of the target song to the chord sequence of the created song melody within a preset interval threshold and the musical form melody envelope range; starting from the phrase ending note of the created song melody, while keeping the melodic rhythm pattern of the chord sequence unchanged, the created song melody is generated in reverse.
[0023] In another embodiment of this disclosure, the apparatus further includes a processing module for harmonizing the dissonant notes of the melody of the composed song.
[0024] In another embodiment of this disclosure, the processing module is specifically configured to, for the last note of the melody of the composed song, adjust the last note of the melody to the tonic if its chord is a tonic chord; and adjust the last note of the melody to the note corresponding to the chord degree closest to its interval if the chord to which the last note of the melody belongs is a non-tonic chord. The processing module is further configured to adjust the first harmonic note in the melody that is on a strong beat and has a duration greater than a first duration to the chord degree closest to its interval, which has the highest probability of being the chord degree of the first stressed beat note in the style of the target song. Specifically, the module is further used to adjust the second harmonic note in the melody of the original song, which is on a non-strong beat and has a duration greater than the second duration, to the note corresponding to the chord degree closest to its interval if it does not belong to a chord tone. The processing module is also used to, for all third harmonic notes not falling into the above categories, determine whether the third harmonic note is a modal note if it is a chord tone, and if it is a non-modal note if it is a non-modal note, adjusting it to the modal note closest to its interval.
[0025] In another embodiment of this disclosure, the first time value is greater than 0 beats and does not exceed 1 beat; the second time value is greater than the first time value.
[0026] In another embodiment of this disclosure, the device further includes: a statistics module, used to count the ratio of the number of times each chord degree of the first accent of a phrase appears to the number of times all chord degrees of the first accent of a phrase appear in songs of each style, thereby obtaining the probability of each chord degree of the first accent of a phrase in each style.
[0027] In a fourth aspect of this disclosure, a computing device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the computing device to perform a song melody creation method as described in any one of the first aspects of this disclosure.
[0028] According to the embodiments of this disclosure, the melody of a song created by extracting multi-dimensional melodic features of songs with the same style as the target song can conform to the common features of the target style in terms of technical features such as melody direction, chord usage, rhythm characteristics, and mode, thereby obtaining a song melody that is similar to the target style overall. Attached Figure Description
[0029] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:
[0030] Figure 1 A schematic diagram illustrating an application scenario according to an embodiment of the present disclosure is provided.
[0031] Figure 2 A schematic flowchart of a song melody creation method according to an embodiment of the present disclosure is shown.
[0032] Figure 3 An example diagram of a split chord sequence provided according to an embodiment of the present disclosure is shown schematically;
[0033] Figure 4 An example diagram illustrating the relationship between chord degrees and note names according to an embodiment of the present disclosure is shown.
[0034] Figure 5 An example diagram illustrating the association between musical phrases and musical form according to an embodiment of this disclosure is shown schematically.
[0035] Figure 6A schematic diagram illustrating a chord and its corresponding chord tone representation provided according to an embodiment of the present disclosure is shown.
[0036] Figure 7 An example diagram illustrating a mode and its tone correspondence table according to an embodiment of the present disclosure is shown schematically.
[0037] Figure 8 An example diagram illustrating a harmonization process provided according to an embodiment of the present disclosure is shown schematically.
[0038] Figure 9 A schematic diagram of the structure of a storage medium provided according to an embodiment of the present disclosure is shown.
[0039] Figure 10 A schematic diagram of the structure of a song melody creation device according to an embodiment of the present disclosure is shown.
[0040] Figure 11 A schematic diagram of the structure of a computing device provided according to an embodiment of the present disclosure is shown.
[0041] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0042] The principles and spirit of this disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0043] Those skilled in the art will understand that the embodiments of this disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. The data involved in this disclosure can be data authorized by the user or fully authorized by all parties. The collection, dissemination, and use of the data comply with relevant national laws and regulations. The embodiments / examples of this disclosure can be combined with each other.
[0044] According to embodiments of this disclosure, a method, medium, apparatus, and computing device for creating song melodies are proposed.
[0045] In this article, it is important to understand that the terms used have the following meanings:
[0046] The musical form envelope: the range from the lowest to the highest note in each musical form of a song;
[0047] Musical form: A section containing information about the song's structure;
[0048] Pitch range: The range of notes between the lowest and highest pitches within a certain time range;
[0049] Rhythm pattern: A set of rhythmic points with start and end times;
[0050] A major leap: an ascending or descending interval equal to or greater than a fourth.
[0051] Furthermore, the number of any elements in the accompanying drawings is for illustrative purposes only and not for limitation, and any naming is for distinction only and has no limiting meaning.
[0052] The principles and spirit of this disclosure will be explained in detail below with reference to several representative embodiments. Invention Overview
[0054] The inventors have discovered that, in related technologies, machine learning methods can be used to train models corresponding to the features of music under each style category, and then generate musical works based on these models. For machine learning, the larger the training dataset, the better the training effect. However, if the user selects a very specific style category, the dataset may shrink significantly, resulting in generated musical works that do not match the user's selected style.
[0055] To address the above issues, the inventors extracted multi-dimensional features from songs with the same style as the target song. In scenarios with limited datasets, the generated melody of a song based on these multi-dimensional features accurately matches the style of the target song.
[0056] After introducing the basic principles of this disclosure, various non-limiting embodiments of this disclosure will be described in detail below.
[0057] Application Scenarios Overview
[0058] First refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario provided for an embodiment of this disclosure.
[0059] like Figure 1 As shown, the user selects a target song, and the system generates a melody for the original song based on that target song. Specifically, it selects songs of the same style as the target song from the music library. For example, if the target song is rock, then rock songs from the music library will be used as the target songs. Music theory information is extracted from the target song, and melodic features are extracted from the music library. The melody for the original song is then generated based on the music theory information and the melodic features.
[0060] Exemplary methods
[0061] The following is combined with Figure 1 Application scenarios, refer to Figure 2-8 This document describes a song melody creation method provided according to exemplary embodiments of the present disclosure. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in any way. Rather, the embodiments of the present disclosure can be applied to any applicable scenario.
[0062] The implementation subject of this disclosure can be a song melody creation device, which can be implemented in various ways. For example, the song melody creation device can be program software; or, the device can be integrated, installed, or stored on a physical device, such as a chip, smart terminal, computer, server, or USB flash drive.
[0063] refer to Figure 2 , Figure 2 This is a flowchart illustrating a song melody creation method provided in one embodiment of this disclosure. Figure 2 As shown, the song melody creation method is used on the server and includes:
[0064] S201. Select the target song from the song library.
[0065] The user can select a target song or choose one randomly. For example, if a user wants to generate a song melody similar to a certain song, that song will be used as the target song. If the user does not have a reference song, a target song will be randomly selected from the music library.
[0066] S202. Determine songs of the same style as the target song from the song library.
[0067] The music library's song styles are pre-labeled. A song can have a single tag, such as rock, pop, classical, or jazz. A song can also have multiple tags, for example, both rock and pop. The number of styles combined is selectable by the user. Understandably, the more styles combined, the smaller the range of songs in the same style, and the closer the melody of the created song will be to the target song.
[0068] S203. Generate the melody of the original song based on the music theory information of the target song and the melodic characteristics of the songs of the same style.
[0069] Among them, music theory information includes multiple dimensions, and melody features include multiple dimensions. The melody of the original song generated through multiple dimensions of features is more in line with the style of the target song.
[0070] In one example, the song melody creation method further includes: annotating the songs in the music library with music theory information; wherein the music theory information includes at least one of the following: meter, musical form, mode, chords, melody pitch, melody rhythm pattern, and musical phrase; extracting the melody features of the songs in the music library based on the music theory information; wherein the melody features of the songs in the music library include at least one of the following: chord segments, phrase-initial accent, phrase-final accent, melody rhythm pattern, and musical form melody envelope.
[0071] As an optional implementation, the songs in the music library are pre-annotated with music theory information. For the meter information annotation, the start and end times of each meter need to be precisely located. For the song form information annotation, the strong beats of the meter data need to be aligned. For the chord information annotation, the meter data needs to be aligned. For the melody pitch and rhythm pattern annotation, the meter needs to be aligned.
[0072] Based on the above implementation methods, by aligning multiple music theory information with the beat, multiple music theory information can be associated through the beat, thereby integrating multiple music theory information to generate melody.
[0073] The following section provides a specific example of extracting the melody features of the songs in the music library.
[0074] In one example, based on the music theory information of the songs in the music library, the melodic features of the songs in the music library are extracted, including: according to the musical structure of the songs in the music library, the chord sequence of the songs in the music library is split to obtain multiple chord fragments, and the chord fragments are labeled with the mode, melodic rhythm pattern, measure length and melodic time signature.
[0075] As an optional implementation method, refer to Figure 3 , Figure 3 This is an example diagram illustrating the splitting of a chord sequence as disclosed in this disclosure. The chord sequence and musical form are aligned using beat information. According to the beat range corresponding to each musical form, the chord sequence is split into multiple chord segments, and the chords of all songs in the music library are split sequentially.
[0076] Based on the above implementation methods, the chord fragments obtained by decomposing the musical form can be associated with different musical forms, and the associated features are more representative.
[0077] In another example, based on the music theory information of the songs in the music library, the melodic features of the songs in the music library are extracted, including: extracting the first accented note of each musical phrase and the last note of each musical phrase; and comparing the chord fragments and the first accented note of the songs in the music library, extracting the chord degree of the first accented note of the songs in the music library.
[0078] For example, the initial accented note is the note on the first beat of the first complete measure in a musical phrase. If there is no note on the first beat of the first complete measure of a phrase, or if there is a note carried over from the previous measure, then the phrase does not have an initial accented note. The final note is the last note in a musical phrase.
[0079] As an optional implementation method, refer to Figure 4 , Figure 4 This is an example diagram of the relationship table between chord degrees and note names, as disclosed in this invention. By associating chord segments with the first accented note of a phrase, the note name of each first accented note is obtained. Then, by referring to the relationship table between chord degrees and note names, the chord degree of each first accented note is obtained. The chord degrees of the first accented notes of all songs in the music library are extracted sequentially.
[0080] Based on the above implementation methods, the initial accent is a characteristic note of a musical phrase, and extracting the chord degree of the initial accent is more representative.
[0081] In another example, based on the music theory information of the songs in the music library, the melodic features of the songs in the music library are extracted, including: determining the musical structure to which each musical phrase of the songs in the music library belongs based on the start time of the musical phrase and the start time of the musical structure of the songs in the music library; taking the range of melodic pitches corresponding to each musical phrase of the songs in the music library as the range of the musical structure to which the musical phrase belongs; and forming the musical melody envelope of the songs in the music library based on the range of all musical structures contained in each song in the music library.
[0082] As an optional implementation method, musical phrases are associated with musical form through rhythmic information, and the melody of musical phrases is associated with musical form. The range of the melody corresponding to each musical form is calculated separately, taking musical form as the unit.
[0083] For example, musical form is a representative unit. In the musical form of rock music, the strong beat of the "chorus" structure accounts for a high proportion.
[0084] Specifically, as an example, musical phrases are associated with musical structures based on the starting beat of the musical phrase and the starting beat of the musical form.
[0085] As an optional implementation method, refer to Figure 5 , Figure 5This is an example diagram illustrating the association between musical phrases and musical forms in this disclosure. If the starting beat of a musical phrase coincides with the starting beat of a musical form, then the musical phrase belongs to that musical form. Otherwise, the belonging is determined based on the beat: if the starting beat of a musical phrase is no more than one measure earlier than the starting beat of a musical form that follows it, then the musical phrase belongs to that musical form; otherwise, the musical phrase belongs to the preceding musical form. For example, if the starting beat of musical phrase A is no more than one measure earlier than the starting beat of musical form A that follows it, then musical phrase A belongs to musical form A. If the starting beat of musical phrase B is more than one measure earlier than the starting beat of musical form B that follows it, then musical phrase B belongs to musical form A. The range of the melody corresponding to musical phrase A and the melody corresponding to musical phrase B is taken as the range of musical form A.
[0086] It should be noted that this disclosure does not restrict the specific rules for the association between musical phrases and musical form.
[0087] Based on the above implementation methods, since the musical form is a representative unit, calculating the range of the melody by taking the musical form as the unit can reflect the stylistic characteristics of the songs in the music library.
[0088] The above method extracts the melodic features of the songs in the music library, and then generates the melody of the original song based on the melodic features of the songs in the music library.
[0089] In one example, S203 includes: selecting chord segments from the chord segments of the songs of the same style that satisfy at least one of the following conditions to form a chord sequence for the melody of the original song; the conditions include: the mode of the chord segments is the same as the mode of the target song, the measure length of the target song is a positive integer multiple of the measure length of the chord segments, and the time signature of the melody of the chord segments is the same as the time signature of the melody of the target song; selecting songs of the same style with the same musical structure as the target song according to the musical structure of the songs of the same style, and extracting the musical structure melodic envelope from them as the musical structure melodic envelope of the original song; within a preset interval threshold and within the range of the musical structure melodic envelope of the original song, generating the phrase ending of the original song melody by adapting the phrase ending of the target song to the chord sequence of the original song melody; starting from the phrase ending of the original song melody, maintaining the melodic rhythm pattern of the chord sequence, and generating the original song melody in reverse.
[0090] As an optional implementation, regarding the selection of chord sequences, for example, if the chord fragment's key includes major and minor, and the target song is in a major key, then a major chord sequence should be selected; the same applies to minor keys. If the target song's measure length is 8 measures, then an 8-measure or 4-measure chord sequence can be selected; a chord sequence with a measure length of 5 or 6 measures, or other measure lengths that are not factors of 8, cannot be selected. If the target song's melody is in 4 / 4 time, then a 4 / 4 time chord sequence should be selected; a 3 / 4 time chord sequence cannot be selected.
[0091] As another alternative implementation, regarding the determination of the melodic envelope, for example, if the target song's structure includes a "verse," a "chorus," and a "bridge," then a song of the same style that also includes a "verse," a "chorus," and a "bridge" is selected. It can be understood that the selected song of the same style has similar structural characteristics to the target song. The melodic envelope characteristics extracted from the selected song of the same style are also similar to those of the target song.
[0092] As another alternative implementation method, for generating the melody of a song, for example, starting with the last note of a phrase and generating the melody in reverse, can avoid large leaps at the end when generating the melody in the forward direction. Similarly, by setting an interval threshold, large leaps within a phrase of the melody can be avoided.
[0093] Based on the above implementation method, by referring to the characteristics of the target song to select chord segments and musical structure of the original song melody, the style of the generated original song melody accurately matches the style of the target song.
[0094] In one example, the method for creating a song melody also includes harmonizing the dissonant notes of the created song melody.
[0095] For example, the melody of the original song generated in the above example is automatically generated based on the melody characteristics, which may lead to harmony issues, so it needs to be harmonized.
[0096] The following examples illustrate the harmonization process.
[0097] In one example, the song melody creation method also includes: calculating the ratio of the number of times each phrase-initial accent chord degree appears to the total number of times all phrase-initial accent chord degrees appear in songs of each style, and obtaining the probability of each phrase-initial accent chord degree in each style.
[0098] For example, in rock songs, the probability of "Fa" being the third degree of a chord when it is the first accented beat of a phrase is 10%, and the probability of "So" being the fifth degree of a chord when it is the first accented beat of a phrase is 30%.
[0099] It is understandable that the probability characteristics of chord tones are related to style, and using them to generate melodies for original songs can improve the degree of conformity with the style of the target song.
[0100] In another example, harmonizing the dissonant notes of the melody includes: for the last note of the melody, if its chord is a tonic chord, adjusting the last note to the tonic of the mode; if the last note of the melody belongs to a non-tonic chord, adjusting the last note to the note corresponding to the chord degree closest to its interval; for non-terminal notes of the melody, the following harmonization process is performed: the first harmonic note in the melody that is on a strong beat and has a duration greater than the first duration is adjusted to the chord degree closest to its interval, within the style of the target song. The chord tone with the highest probability of being the stressed note at the beginning of a phrase; for the second harmonic note in the melody of the original song that is not on a strong beat and has a duration greater than the second duration, if it is not a chord tone, then the second harmonic note is adjusted to the note corresponding to the chord tone closest to its interval; for all third harmonic notes that are not in the above situation, if the third harmonic note is a chord tone, then no adjustment is made; if the third harmonic note is not a chord tone, then it is determined whether the third harmonic note is a modal note; if the third harmonic note is a modal note, then no adjustment is made; if the third harmonic note is a non-modal note, then the third harmonic note is adjusted to the modal note closest to its interval.
[0101] As an example, we can create a table of chords and their corresponding chord tones, as well as a table of modes and their corresponding mode tones.
[0102] For example, refer to Figure 6 as well as Figure 7 , Figure 6 This is an example diagram of chords and their corresponding chord tones, as disclosed in this disclosure. Figure 7 This is an example diagram of a mode and its tone correspondence table, as disclosed in this disclosure. Dissonant notes are harmonized according to chords and their tone correspondence tables, as well as modes and their tone correspondence tables.
[0103] As an optional implementation method, refer to Figure 8 , Figure 8This is an example diagram illustrating the harmonicization process disclosed herein. Adjusting the note to the chord tone corresponding to the chord degree with the closest interval relationship can improve the harmony of a song's melody with minimal impact on its stylistic characteristics. For example, if the first harmonic note is "#Fa", and the chord tone corresponding to its closest interval relationship is "Fa" and "So", in songs of the same style, the probability of "Fa" being the chord tone on the first accented beat of a phrase is 10%, and the probability of "So" being the chord tone on the first accented beat of a phrase is 30%. Therefore, the first harmonic note is adjusted to "So".
[0104] In yet another example, the song melody creation method further includes: the first time value is greater than 0 beats and does not exceed 1 beat; the second time value is greater than the first time value.
[0105] It should be noted that this disclosure does not limit the specific values of the first and second time values.
[0106] It is understandable that by setting the first and second time values, the strength of the harmonization process can be determined.
[0107] Based on the above implementation methods, harmonizing dissonant notes by using the chord degrees with the closest interval relationships can improve the harmony of a song's melody with minimal impact on its style.
[0108] The song melody creation method provided in this embodiment selects a target song from a song library; determines songs of the same style as the target song from the song library; and generates a melody for the created song based on the music theory information of the target song and the melodic features of the songs of the same style. This solution, by extracting multi-dimensional melodic features from songs of the same style as the target song to generate a melody, can accurately match the style of the target song.
[0109] Exemplary media
[0110] After introducing the methods of exemplary embodiments of this disclosure, the following references are made. Figure 9 The storage medium of the exemplary embodiments of this disclosure will be described.
[0111] refer to Figure 9 As shown, the storage medium 90 stores a program product for implementing the above-described method according to embodiments of the present disclosure. This program product may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a device such as a personal computer. However, the program product of the present disclosure is not limited thereto.
[0112] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0113] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium.
[0114] Program code for performing the operations disclosed herein can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).
[0115] Exemplary device
[0116] Having introduced the medium of exemplary embodiments of this disclosure, the following references are made to... Figure 10 The song melody creation apparatus of the exemplary embodiments of this disclosure will be described to implement the method in any of the above method embodiments. The implementation principle and technical effect are similar, and will not be repeated here.
[0117] refer to Figure 10 , Figure 10 This is a schematic diagram of the structure of a song melody creation device provided in one embodiment of the present disclosure. Figure 10 As shown, it includes:
[0118] The selection module 101 is used to select a target song from the music library.
[0119] The user can select a target song or choose one randomly. For example, if a user wants to generate a song melody similar to a certain song, that song will be used as the target song. If the user does not have a reference song, a target song will be randomly selected from the music library.
[0120] The determining module 102 is used to determine songs of the same style as the target song from the songs in the music library.
[0121] The music library has pre-labeled song styles, which can be a single style, such as rock, pop, classical, or jazz. It can also be a combination of multiple styles, such as a combination of rock and upbeat music, or pop and casual music. The number of styles combined is selectable by the user. Understandably, the more styles combined, the smaller the range of songs in the same style, and the closer the melody of the created song will be to the target song.
[0122] The creation module 103 is used to generate a melody for a song based on the music theory information of the target song and the melodic characteristics of songs of the same style.
[0123] Among them, music theory information includes multiple dimensions, and melody features include multiple dimensions. The melody of the original song generated through multiple dimensions of features is more in line with the style of the target song.
[0124] In one example, the song melody creation device further includes: an annotation module 104, used to annotate the songs in the music library with music theory information; wherein the music theory information includes at least one of the following: beat, musical form, mode, chord, melody pitch, melody rhythm pattern, and musical phrase; and an extraction module 105, used to extract the melody features of the songs in the music library based on the music theory information; wherein the melody features of the songs in the music library include at least one of the following: chord fragments, phrase-initial accent, phrase-final note, melody rhythm pattern, and musical form melody envelope.
[0125] The following section provides a specific example of extracting the melody features of the songs in the music library.
[0126] In one example, the extraction module 105 is specifically used to split the chord sequence of the songs in the music library according to the musical structure of the songs in the music library, and obtain multiple chord fragments. The chord fragments are labeled with the key, melodic rhythm pattern, measure length and melodic time signature.
[0127] In another example, the extraction module 105 is specifically used to extract the first accent of each musical phrase and the last accent of each musical phrase; by comparing the chord fragments and the first accent of the musical phrases of the songs in the music library, the chord degree of the first accent of the musical phrases of the songs in the music library is extracted.
[0128] In another example, the extraction module 105 is specifically used to determine the musical structure to which each musical phrase of the song in the music library belongs based on the start time of the musical phrase and the start time of the musical structure of the song in the music library; the extraction module 105 is also specifically used to take the range of melodic pitch corresponding to each musical phrase of the song in the music library as the range of the musical structure to which the musical phrase belongs; the extraction module 105 is also specifically used to form the musical melody envelope of the song in the music library based on the range of all musical structures contained in each song in the music library.
[0129] The above method extracts the melodic features of the songs in the music library, and then generates the melody of the original song based on the melodic features of the songs in the music library.
[0130] In one example, the creation module 103 is used to select chord segments from the chord segments of the same style songs that satisfy at least one of the following conditions to form a chord sequence for the melody of the created song; the conditions include: the mode of the chord segment is the same as the mode of the target song, the measure length of the target song is a positive integer multiple of the measure length of the chord segment, and the time signature of the melody of the chord segment is the same as the time signature of the melody of the target song; the creation module 103 is also used to select songs of the same style with the same musical structure as the target song according to the musical structure of the same style songs, and extract the musical form melodic envelope from them as the musical form melodic envelope of the created song melody; the creation module 103 is also used to generate the phrase ending of the created song melody by adapting the phrase ending of the target song to the chord sequence of the created song melody within a preset interval threshold and the musical form melodic envelope range; starting from the phrase ending of the created song melody, the melody of the created song is generated in reverse while keeping the melodic rhythm pattern of the chord sequence unchanged.
[0131] In one example, the method for creating a song melody also includes harmonizing the dissonant notes of the created song melody.
[0132] For example, the melody of the original song generated in the above example is automatically generated based on the melody characteristics, which may lead to harmony issues, so it needs to be harmonized.
[0133] The following examples illustrate the harmonization process.
[0134] In one example, the song melody creation device also includes: a statistics module 107, used to count the ratio of the number of times each phrase-initial accent chord degree appears to the total number of times all phrase-initial accent chord degrees appear under each style of song library, and to obtain the probability of each phrase-initial accent chord degree under each style.
[0135] In another example, processing module 106 is specifically used to adjust the last note of the melody of the composed song to the tonic if its chord is a tonic chord; if the chord to which the last note of the melody belongs is a non-tonic chord, then the last note of the melody is adjusted to the note corresponding to the chord degree closest to its interval relationship; for non-terminal notes of the melody, the following harmonicization processing is performed: processing module 106 is further used to adjust the first harmonic position note in the melody that is on a strong beat and has a duration greater than a first duration to the chord degree closest to its interval relationship, which has the highest probability of being the chord degree of the first stressed beat note in the style of the target song. The processing module 106 is further configured to, for the second harmonic note in the melody of the original song that is not on a strong beat and has a duration greater than the second duration, adjust the second harmonic note to the note corresponding to the chord degree closest to its interval if it does not belong to a chord tone; the processing module 106 is further configured to, for all third harmonic notes that are not in the above situation, if the third harmonic note belongs to a chord tone, no adjustment is made; if the third harmonic note does not belong to a chord tone, then it is determined whether the third harmonic note is a modal note; if the third harmonic note is a modal note, no adjustment is made; if the third harmonic note is an unmodal note, then the third harmonic note is adjusted to the modal note closest to its interval.
[0136] In yet another example, the first time value is greater than 0 beats and does not exceed 1 beat; the second time value is greater than the first time value.
[0137] The song melody creation device provided in this embodiment includes a selection module for selecting a target song from a song library; a determination module for determining songs of the same style as the target song from the song library; and a creation module for generating a melody based on the music theory information of the target song and the melodic features of the songs of the same style. This solution, by extracting multi-dimensional melodic features from songs of the same style as the target song to generate a melody, can accurately match the style of the target song.
[0138] Exemplary computing device
[0139] Having described the methods, media, and apparatus of exemplary embodiments of this disclosure, the following references... Figure 11 A computing device according to an exemplary embodiment of the present disclosure will be described.
[0140] Figure 11 The computing device 110 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0141] like Figure 11 As shown, the computing device 110 is presented in the form of a general-purpose computing device. The components of the computing device 110 may include, but are not limited to: at least one processing unit 1101, at least one storage unit 1102, and a bus 1103 connecting different system components (including the processing unit 1101 and the storage unit 1102).
[0142] Bus 1103 includes a data bus, a control bus, and an address bus.
[0143] Storage unit 1102 may include readable media in the form of volatile memory, such as random access memory (RAM) 11021 and / or cache memory 11022, and may further include readable media in the form of non-volatile memory, such as read-only memory (ROM) 11023.
[0144] Storage unit 1102 may also include a program / utility 11025 having a set (at least one) of program modules 11024, such program modules 11024 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0145] The computing device 110 can also communicate with one or more external devices 1104 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 1105. Furthermore, the computing device 110 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1106. Figure 11 As shown, network adapter 1106 communicates with other modules of computing device 110 via bus 1103. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with computing device 110, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0146] It should be noted that although several units / modules or sub-units / modules of the song melody creation device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0147] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0148] While the spirit and principles of this disclosure have been described with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method of creating a melody of a song, characterized by, The method comprises: selecting a target song from a song library; determining a same-style song of the target song from the song library; generating a creative song melody according to the music theory information of the target song and the melody features of the same-style song; the generating a creative song melody according to the music theory information of the target song and the melody features of the same-style song comprises: selecting a chord segment that satisfies at least one of the following conditions from the chord segments of the same-style song to form a chord sequence of the creative song melody; the conditions include: the mode of the chord segment is consistent with the mode of the target song, the measure length of the chord segment is a positive integer multiple of the measure length of the target song, and the time signature of the melody of the chord segment is consistent with the time signature of the melody of the target song; selecting a same-style song with the same form structure as the target song according to the form structure of the same-style song, and extracting a form melody envelope line of the same-style song as a form melody envelope line of the creative song melody; generating a cadence of the creative song melody by adapting the cadence of the target song to the chord sequence of the creative song melody within a preset interval threshold and the range of the form melody envelope line of the creative song melody; and generating the creative song melody from the cadence of the creative song melody by keeping the melody rhythm pattern of the chord sequence unchanged.
2. The method of claim 1, wherein, The method further comprises: annotating the song library with music theory information; wherein the music theory information includes at least one of the following: tempo, form structure, mode, chord, melody pitch, melody rhythm pattern, and musical phrase; extracting the melody features of the song library according to the music theory information of the song library; wherein the melody features of the song library include at least one of the following: chord segment, initial accent, cadence, melody rhythm pattern, and form melody envelope line.
3. The method of claim 2, wherein, The extracting the melody features of the song library according to the music theory information of the song library comprises: splitting the chord sequence of the song library according to the form structure of the song library to obtain a plurality of chord segments, wherein the chord segments are annotated with mode, melody rhythm pattern, measure length, and time signature of the melody.
4. The method of claim 2, wherein, The extracting the melody features of the song library according to the music theory information of the song library comprises: extracting the initial accent of each musical phrase and the cadence of each musical phrase; comparing the chord segments and the initial accents of the song library to extract the chord degrees of the initial accents of the song library.
5. The method of claim 2, wherein, The extracting the melody features of the song library according to the music theory information of the song library comprises: determining the form structure to which each musical phrase of the song library belongs according to the start time of the musical phrase and the start time of the form structure of the song library; regarding the range of the melody pitch corresponding to each musical phrase of the song library as the pitch range of the form structure to which the musical phrase belongs; composing the form melody envelope line of the song library based on the pitch ranges of all form structures contained in the song library.
6. The method of claim 1, wherein, The method further comprises: harmonizing the non-harmonic notes of the creative song melody.
7. The method of claim 6, wherein, The non-harmonic note of the created song melody is subjected to a harmonization process, including: For the last note of the created song melody, if the chord to which the last note belongs is a main chord, the last note of the created song melody is adjusted to be a tonal main note; if the chord to which the last note of the created song melody belongs is a non-main chord, the last note of the created song melody is adjusted to be a note corresponding to a chord tone closest in interval relationship; For a non-end-of-sentence note of the created song melody, the following harmonization process is performed: For a first harmonization position note in the created song melody which is in a strong beat and has a time value greater than a first time value, the first harmonization position note is adjusted to be a chord tone in which a chord tone closest in interval relationship has a highest chord tone probability of a strong beat at the beginning of a sentence under the style of the target song; For a second harmonization position note in the created song melody which is in a non-strong beat and has a time value greater than a second time value, if the second harmonization position note does not belong to a chord tone, the second harmonization position note is adjusted to be a note corresponding to a chord tone closest in interval relationship; For all third harmonization position notes which do not belong to the above cases, if the third harmonization position note belongs to a chord tone, no adjustment is made; if the third harmonization position note does not belong to a chord tone, it is further judged whether the third harmonization position note is a tonal note, if the third harmonization position note is a tonal note, no adjustment is made; if the third harmonization position note is a non-tonal note, the third harmonization position note is adjusted to be a tonal note closest in interval relationship.
8. The method of claim 7, wherein, The method further includes: The first time value is greater than 0 beats and does not exceed 1 beat; and the second time value is greater than the first time value.
9. The method of claim 7, wherein, The method further includes: The probability of each chord tone of each strong beat at the beginning of a sentence under each style is obtained by counting a ratio of a number of times of occurrence of each chord tone of each strong beat at the beginning of a sentence to a number of times of occurrence of all chord tones of all strong beats at the beginning of a sentence.
10. A computer-readable storage medium comprising: The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the song melody creation method according to any one of claims 1 to 9.
11. A song melody creation device, the device comprising: a selection module configured to select a target song from a song library; a determination module configured to determine same-style songs of the target song from the song library; a creation module configured to generate a created song melody according to music theory information of the target song and melody characteristics of the same-style songs. The creation module is specifically configured to: select a chord segment that satisfies at least one of the following conditions from the chord segments of the same-style songs to form a chord sequence of a created song melody; the conditions include: a mode of the chord segment is consistent with a mode of the target song, a measure length of the chord segment is a positive integer multiple of a measure length of the target song, and a time signature of a melody of the chord segment is consistent with a time signature of a melody of the target song; select a same-style song with a same form structure as a form structure of the target song according to a form structure of the same-style songs, and extract a form melody envelope line of the same-style song as a form melody envelope line of the created song melody; generate a cadence of the created song melody by adapting the cadence of the target song to the chord sequence of the created song melody within a preset interval threshold and a range of the form melody envelope line of the created song melody; and generate the created song melody starting from the cadence of the created song melody while keeping a melody rhythm pattern of the chord sequence unchanged.
12. The apparatus of claim 11, wherein, The device further includes: The labeling module is configured to label the music library songs with music theory information, where the music theory information includes at least one of the following: a beat, a form structure, a mode, a chord, a melody pitch, a melody rhythm pattern, and a musical phrase; The extraction module is configured to extract melody features of the music library songs according to the music theory information of the music library songs, where the melody features of the music library songs include at least one of the following: a chord segment, a phrase head accent note, a cadence, a melody rhythm pattern, and a form melody envelope line.
13. The device of claim 12, wherein The extraction module is specifically configured to split a chord sequence of the music library song according to a form structure of the music library song to obtain a plurality of chord segments, and the chord segments are labeled with a mode, a melody rhythm pattern, a measure length, and a time signature of a melody.
14. The device of claim 12, wherein The extraction module is specifically configured to extract a phrase head accent note of each musical phrase and a cadence of each musical phrase. The extraction module is further configured to extract a chord level of the phrase head accent note of the music library song by comparing the chord segment and the phrase head accent note of the music library song.
15. The device of claim 12, wherein The extraction module is specifically configured to determine a form structure to which each musical phrase of the music library song belongs according to a starting time of the musical phrase and a starting time of the form structure of the music library song. The extraction module is further configured to take a range of melody pitches of each musical phrase of the music library song as a tonal range of the form structure to which the musical phrase belongs. The extraction module is further configured to form a form melody envelope line of the music library song based on tonal ranges of all form structures included in the music library song.
16. The apparatus of claim 11, wherein, The device further includes: The processing module is configured to perform harmonization processing on non-harmonic notes of the created song melody.
17. The device of claim 16, wherein The processing module is specifically configured to adjust the last note of the created song melody to a tonal tonic if the chord to which the last note belongs is a tonic chord; and adjust the last note of the created song melody to a note corresponding to a chord degree closest to the last note in terms of interval relationship if the chord to which the last note belongs is a non-tonic chord. The processing module is further configured to adjust a first consonant note in the created song melody, which is on a strong beat and has a time value greater than a first time value, to a chord tone of a chord degree closest to the first consonant note in terms of interval relationship, which has a highest chord tone probability of a strong beat note at the beginning of a phrase under the style of the target song. The processing module is further configured to adjust a second consonant note in the created song melody, which is on a non-strong beat and has a time value greater than a second time value, to a note corresponding to a chord degree closest to the second consonant note in terms of interval relationship if the second consonant note is not a chord tone. The processing module is further configured to, for all third consonant notes that do not belong to the above cases, not adjust the third consonant note if the third consonant note is a chord tone; and not adjust the third consonant note if the third consonant note is a tonal note; and adjust the third consonant note to a tonal note closest to the third consonant note in terms of interval relationship if the third consonant note is a non-tonal note.
18. The apparatus of claim 17, wherein the first time value is greater than 0 beats and does not exceed 1 beat; and the second time value is greater than the first time value.
19. The apparatus of claim 17, wherein, The apparatus further includes: a statistical module configured to count a ratio of a number of times that each chord tone of each strong beat note at the beginning of a phrase appears to a number of times that all chord tones of all strong beat notes at the beginning of a phrase appear, to obtain a probability of each chord tone of each strong beat note at the beginning of a phrase under each style.
20. A computing device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the computing device to perform the method of creating a song melody according to any one of claims 1 to 9.
Citation Information
Patent Citations
Automatic generation of melodies
CN110555126A