Melody adaptation method and apparatus, device, storage medium, and program product
By obtaining and matching musical sound adaptation rules, the existing melody adaptation model's resource consumption and low adaptation efficiency are solved, and the structure and effect of melody adaptation are improved, making it more in line with the aesthetics of music theory.
Patent Information
- Application Number
- PCT/CN2024/137604
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-21
- Filing Date
- 2024-12-06
- Publication Date
- 2025-06-26
AI Technical Summary
The existing melody adaptation model has shortcomings in resource consumption and adaptation efficiency, and the adaptation quality depends on sample quality, poor stability, and poor adaptation effect.
By obtaining the first musical tone sequence and at least two musical tone adaptation rules, determine and apply appropriate adaptation rules to adapt the musical elements to generate a new musical tone sequence based on the matching relationship between the musical elements and the adaptation rules.
It improves the structure of the adapted musical sound sequence, enhances the melody adaptation ability, improves the melody adaptation effect, and makes it more in line with the aesthetics of music theory.
Smart Images

Figure CN2024137604_26062025_PF_FP_ABST
Abstract
Description
Melody adaptation method, device, equipment, storage medium and program product
[0001] This application claims priority to Chinese patent application number 202311778611.4, filed on December 21, 2023, entitled “Melody processing method, device, equipment, storage medium and program product”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of audio technology, and in particular to a melody adaptation method, apparatus, device, storage medium, and program product. Background Art
[0003] Melody adaptation refers to obtaining a new musical sequence by adapting the musical elements in the original musical sequence, so that the auditory experience of the new musical sequence is different from that of the original musical sequence.
[0004] In related technologies, deep learning is used to achieve melody adaptation. A melody adaptation model is obtained through pre-training, and the original musical tone sequence is input into the melody adaptation model, and a new musical tone sequence with different musical elements from the original musical tone sequence is output.
[0005] However, since the melody adaptation model is an adaptation model obtained through sample training, the resources consumed in the training process and the adaptation prediction process are large, and the adaptation efficiency is low; in addition, the adaptation quality of the melody adaptation model depends on the sample quality, the adaptation stability is poor, and the adaptation effect is poor. Summary of the Invention
[0006] The embodiments of the present application provide a melody adaptation method, apparatus, device, storage medium, and program product, which can improve the structure of the adapted musical tone sequence, thereby enhancing the melody adaptation capability and improving the melody adaptation effect. The technical solution is as follows.
[0007] In one aspect, a melody adaptation method is provided, the method comprising:
[0008] Obtaining a first musical tone sequence, the first musical tone sequence including at least two notes arranged in a melody playback order, the notes corresponding to at least two musical elements;
[0009] Acquire at least two musical sound adaptation rules, wherein the musical sound adaptation rules are used to adjust musical elements corresponding to notes in the first musical sound sequence, and the musical sound adaptation rules have a matching relationship with the musical elements;
[0010] determining, based on a first musical element in the first musical tone sequence and the matching relationship, a first adaptation rule matching the first musical element from the at least two musical tone adaptation rules;
[0011] adapting the first musical element according to the first adaptation rule to obtain an element adjustment result corresponding to the first musical element;
[0012] A second musical tone sequence is generated based on element adjustment results corresponding to at least two musical elements of the first musical tone sequence.
[0013] In another aspect, a melody adaptation device is provided, comprising:
[0014] an acquisition module, configured to acquire a first musical tone sequence, wherein the first musical tone sequence includes at least two notes arranged in a melody playback order, wherein the notes correspond to at least two musical elements;
[0015] The acquisition module is further configured to acquire at least two musical tone adaptation rules, wherein the musical tone adaptation rules are used to adjust the musical elements corresponding to the notes in the first musical tone sequence, and the musical tone adaptation rules and the musical elements have a matching relationship;
[0016] a determining module configured to determine, based on a first musical element in the first musical tone sequence and the matching relationship, a first adaptation rule that matches the first musical element from the at least two musical tone adaptation rules;
[0017] an adaptation module, configured to adapt the first music element according to the first adaptation rule to obtain an element adjustment result corresponding to the first music element;
[0018] A generating module is configured to generate a second musical tone sequence based on element adjustment results corresponding to at least two musical elements of the first musical tone sequence.
[0019] In some embodiments, the determination module is configured to determine a first musical element corresponding to a specified note in a first musical tone sequence from the at least two musical elements; and obtain the first adaptation rule from the at least two musical tone adaptation rules based on the first musical element and the matching relationship.
[0020] In some embodiments, the determination module is used to divide the first musical sound sequence to obtain at least two musical sound subsequences, each of which includes at least two adjacently arranged notes; obtain a first musical sound subsequence from the at least two musical sound subsequences, each of which includes the specified note; and determine the first musical element from the musical elements corresponding to the specified note.
[0021] In some embodiments, the first adaptation rule comprises a pitch adaptation rule, wherein the pitch adaptation rule is used to adjust the pitch of the note;
[0022] The adaptation module is used to adjust the first pitch height corresponding to the first note in the first music sequence based on the pitch adaptation rule to obtain the second pitch height corresponding to the first note, and as the element adjustment result, the first pitch height is different from the second pitch height.
[0023] In some embodiments, the adaptation module is used to obtain a preset pitch adjustment value; and to increase or decrease the first pitch height by using the pitch adjustment value as an adjustment amplitude to obtain the second pitch height.
[0024] In some embodiments, the first adaptation rule includes a note adding rule, wherein the note adding rule is used to instruct to add a passing note between two adjacent notes;
[0025] The adaptation module is used to obtain the second note and the third note arranged adjacently in the first musical tone sequence, and to obtain the passing tone note; and to add the passing tone note between the second note and the third note to obtain a note adding result as the element adjustment result.
[0026] In some embodiments, the adaptation module is used to obtain a note with a pitch between the second note and the third note as the passing note when the second note and the third note have different pitches; or, to obtain a preset passing note; or, to adjust the pitch of the second note by a preset adjustment amplitude to obtain the passing note; or, to adjust the pitch of the third note by a preset adjustment amplitude to obtain the passing note.
[0027] In some embodiments, the adaptation module is used to traverse at least two notes in the first musical tone sequence; and obtain two adjacent notes in the at least two notes that meet the interval requirement in rhythm as the second note and the third note.
[0028] In some embodiments, the first adaptation rule includes a rhythm adjustment rule, wherein the rhythm adjustment rule is used to adjust the duration of a note;
[0029] The adaptation module is used to determine a fourth note in the first musical tone sequence, where the fourth note corresponds to a first tone length; obtain a tone length adjustment parameter based on the rhythm adjustment rule; and adjust the first tone length based on the tone length adjustment parameter to obtain a second tone length corresponding to the fourth note, where the second tone length is different from the first tone length as the element adjustment result.
[0030] In some embodiments, the adaptation module is used to obtain a first rhythm type based on the rhythm adjustment rule, wherein the first rhythm type includes the sound lengths corresponding to at least two notes respectively; and adjust the sound lengths corresponding to the at least two notes in the first musical tone sequence based on the first rhythm type to obtain the element adjustment result.
[0031] In some embodiments, the first musical tone sequence includes an accompaniment sequence, the accompaniment sequence includes at least two chord notes, and the first adaptation rule includes a chord adjustment rule, the chord adjustment rule being used to adjust the chord notes;
[0032] The adaptation module is used to obtain the adjacent first chord note and second chord note in the accompaniment sequence, and obtain the auxiliary chord note; and add the auxiliary chord note between the first chord note and the second chord note as the element adjustment result.
[0033] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the melody adaptation method described in any of the above-mentioned embodiments of the present application.
[0034] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the melody adaptation method as described in any of the above embodiments of the present application.
[0035] In another aspect, a computer program product or computer program is provided. The computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the melody adaptation method described in any of the above embodiments.
[0036] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0037] In the case of obtaining a first musical tone sequence comprising at least two musical elements and at least two musical tone adaptation rules, based on the matching relationship between the musical tone adaptation rules and the musical elements, the first musical element is musically adapted according to the first adaptation rule to obtain an element adjustment result, and a second musical tone sequence is generated based on the element adjustment result corresponding to at least one musical element. That is, based on basic music theory, harmony, and other techniques and rules, by presetting at least two musical tone adaptation rules, an adaptation rule matching the musical element is selected to perform musical adaptation on the musical element, obtaining an element adjustment result corresponding to the musical element, and a second musical tone sequence is generated based on the element adjustment results corresponding to the at least two musical elements of the first musical tone sequence. This improves adaptation efficiency, makes the melodic structure of the adapted musical sequence more complete, conforms to musical theory and aesthetics, improves the rationality of the melody adaptation, and enhances the melody adaptation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] FIG1 is a schematic diagram of a melody adaptation system provided by an exemplary embodiment of the present application;
[0039] FIG2 is a flow chart of a melody adaptation method provided by an exemplary embodiment of the present application;
[0040] FIG3 is a flow chart of a melody adaptation method provided by another exemplary embodiment of the present application;
[0041] FIG4 is a schematic diagram of a pitch adjustment process provided by yet another exemplary embodiment of the present application;
[0042] FIG5 is a schematic diagram of a note adding process provided by an exemplary embodiment of the present application;
[0043] FIG6 is a schematic diagram of a rhythm adjustment process provided by an exemplary embodiment of the present application;
[0044] FIG7 is a schematic diagram of a chord adjustment process provided by another exemplary embodiment of the present application;
[0045] FIG8 is a schematic diagram of a melody adaptation method provided by an exemplary embodiment of the present application;
[0046] FIG9 is a structural block diagram of a melody adaptation device provided by an exemplary embodiment of the present application;
[0047] FIG10 is a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0048] Related technologies use deep learning to achieve melody adaptation. A melody adaptation model is pre-trained, then fed into the original musical sequence. The model then outputs a new musical sequence with different musical elements from the original. However, because the melody adaptation model performs a specific adaptation operation on the input musical sequence, the resulting adapted sequence has poor melodic structure, resulting in weak melody adaptation capabilities and poor adaptation results.
[0049] Furthermore, melody adaptation using deep learning models relies on training datasets, and the effectiveness of adaptation is strongly correlated with the quality and quantity of training data. When sample data sources are limited and of varying quality, the training effect of the machine learning model is poor, making controllability and stability difficult to ensure. Furthermore, the training and sampling of large amounts of sample data increases computing power and training time.
[0050] The method provided in the embodiments of this application uses basic music theory, harmony, and other techniques and rules to create similar melody arrangements with minimal complexity. This is a rule-based method that is highly stable and fast. This can be achieved through the design of well-designed rules.
[0051] In an embodiment of the present application, a melody adaptation method is introduced. By presetting at least two musical sound adaptation rules, a first adaptation rule matching a first musical element of a first musical sound sequence is selected to perform musical adaptation on the first musical element of the first musical sound sequence, thereby obtaining an element adjustment result corresponding to the first musical element. Finally, a second musical sound sequence is generated based on the element adjustment results corresponding to the musical elements of the first musical sound sequence. This makes the melodic structure of the finally adapted musical sequence more complete, conforms to musical aesthetics, improves the rationality of the melody adaptation, and enhances the melody adaptation effect.
[0052] It should be noted that before collecting the user's relevant data and during the process of collecting the user's relevant data, this application can display a prompt interface, pop-up window or output voice prompt information. The prompt interface, pop-up window or voice prompt information is used to remind the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining the user's relevant data after obtaining the user's confirmation operation on the prompt interface or pop-up window. Otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the user's relevant data are terminated, that is, the user's relevant data is not obtained. In other words, all user data collected by this application are collected with the user's consent and authorization, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant region.
[0053] Next, the melody adaptation system involved in the embodiments of the present application is described. The melody adaptation method provided in the embodiments of the present application can be implemented by a terminal alone, by a server, or by a terminal and a server through data interaction, which is not limited in the embodiments of the present application. Optionally, the melody adaptation method is described using the interaction between a terminal and a server as an example.
[0054] Schematically, please refer to FIG. 1 , the melody adaptation system involves a terminal 110 and a server 120 , and the terminal 110 and the server 120 are connected via a communication network 130 .
[0055] In some embodiments, the terminal 110 runs an application with an audio playback function. When the terminal 110 inputs a first musical tone sequence through the application, the first musical tone sequence is sent to the server 120 for melody adaptation.
[0056] The first musical tone sequence includes at least two notes arranged in a melody playing order, and each note corresponds to at least two musical elements.
[0057] In some embodiments, when the server 120 pre-stores a plurality of musical tone arrangement rules, wherein the musical tone arrangement rules are used to adjust the musical elements corresponding to the notes in the first musical tone sequence, there is a matching relationship between the musical tone arrangement rules and the musical elements.
[0058] In some embodiments, after obtaining a first musical tone sequence, the server 120 determines a first musical element in the first musical tone sequence for adaptation. Based on the first musical element and the matching relationship, the server 120 determines a first adaptation rule that matches the first musical element from among multiple musical tone adaptation rules. The server adapts the first musical element in the first musical tone sequence using the first adaptation rule to obtain an element adjustment result corresponding to the first musical element. Finally, the server 120 generates a second musical tone sequence based on the element adjustment results corresponding to the multiple musical elements in the first musical tone sequence. The server 120 then feeds the second musical tone sequence back to the terminal 110.
[0059] In some embodiments, after receiving the second musical tone sequence, the terminal 110 may play the second musical tone sequence.
[0060] It is worth noting that the above-mentioned terminals include but are not limited to mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, etc., and can also be implemented as desktop computers, etc.; the above-mentioned servers can be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services.
[0061] Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, applications, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.
[0062] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system.
[0063] In combination with the above-mentioned noun introduction and application scenarios, the melody adaptation method provided in this application is described. The method is executed by a computer device, wherein the computer device can be a terminal or a server, or the terminal and the server can jointly execute through data interaction. The method is described by taking the execution of the server as an example. As shown in Figure 2, the method includes the following steps 210 to 250.
[0064] Step 210: Acquire a first musical tone sequence.
[0065] The first musical tone sequence includes at least two notes arranged in a melody playback order, where the notes correspond to at least two musical elements. The at least two notes in the first musical tone sequence are played sequentially in the order in which they are played, thereby generating the melody corresponding to the first musical tone sequence. In some embodiments, the at least two notes are played sequentially according to musical elements such as rhythm and pitch to generate the melody corresponding to the first musical tone sequence.
[0066] Schematically, a musical tone sequence refers to a musical segment obtained by arranging multiple notes in the order of melody playback. A musical tone sequence can be any of a melody segment, a harmony segment, and a rhythm segment. In some embodiments, a musical tone sequence is a segment in a complete musical work, and the musical work is divided according to rhythm to obtain multiple musical tone sequences. Among them, the musical work is divided according to the rhythm with bars as the division unit to obtain multiple musical tone sequences; or the musical work is divided according to the verse and chorus as the division unit to obtain multiple musical tone sequences. The embodiment of the present application does not limit the division method of the musical tone sequence.
[0067] The playing effect of the musical tone sequence is obtained by playing the musical notes in sequence, wherein the playing order of the musical notes is the melody playing order of the musical tone sequence.
[0068] Optionally, the first musical tone sequence is obtained by at least one of the following methods:
[0069] First, the first musical tone sequence is obtained by manual editing and creation; schematically, a musical tone editing area is displayed in the terminal interface, and an editing operation in the musical tone editing area is received, and the first musical tone sequence is obtained based on the editing operation.
[0070] Second, the first musical tone sequence is obtained by intercepting from authorized public music content. For example, if authorization for Symphony A is obtained, a music segment from Symphony A is intercepted as the first musical tone sequence. The interception process can be manual or automatic. When the first musical tone sequence is intercepted by automatic recognition, a music segment is obtained from the music content based on pre-set segment features as the first musical tone sequence. Alternatively, a music segment of the verse or chorus is automatically extracted from the music content based on pre-set verse / chorus nodes as the first musical tone sequence.
[0071] Third, the first musical sound sequence is obtained by integrating at least two public music clips with authorization. For example, music clip a and music clip b are obtained with authorization, and music clip b is connected to music clip a to obtain a new music clip as the first musical sound sequence.
[0072] It is worth noting that the above-mentioned method regarding the first musical tone sequence is only an illustrative example and is not limited to this embodiment of the present application.
[0073] In some embodiments, musical elements refer to the various element contents that constitute a musical sound sequence, including at least one of the element types such as the height of the sound (also known as: pitch), the length of the sound (also known as: length), the strength of the sound (also known as: intensity), and the timbre.
[0074] Schematically, through the mutual combination of musical elements, corresponding formal elements in the musical sequence are formed, such as rhythm, melody, harmony, dynamics, speed, mode, form, chords, structure, texture, etc. Among them, the formal elements constitute the means of performing the musical sequence.
[0075] In some embodiments, a musical sequence includes a main melody and an accompaniment melody. The main melody is the most prominent melodic line in the musical sequence, typically played or sung by the main instrument or vocal part. The accompaniment melody is a melodic line used to support and supplement the main melody, typically played by other instruments or vocal parts. The accompaniment melody can create and complement the overall sound and harmony of the music through chords, repeated rhythms, or other musical elements.
[0076] Therefore, the notes include main melody notes (notes in the main melody) and accompaniment notes (notes in the accompaniment melody).
[0077] The main melody notes include at least one of main notes, treble notes, ornamental notes, staccato notes, repeated notes or rhythmic notes.
[0078] The accompaniment notes include at least one of the following note types: chord notes, bass notes, percussion notes, ornament notes, transition notes, repeated notes, rhythm notes, and the like.
[0079] It is worth noting that the ornamental notes, tuning notes, repeated notes and rhythmic notes in the main melody and the ornamental notes, tuning notes and repeated notes in the accompaniment melody belong to notes on two different pitch lines.
[0080] Schematically, for the same element type, the musical elements corresponding to different notes in the first musical tone sequence are the same or different. Taking the different musical elements as an example, for example: for the pitch type, the first musical tone sequence includes note A and note B, wherein the pitch height corresponding to note A is higher than the pitch height corresponding to note B. Therefore, the musical element corresponding to note A and the musical element corresponding to note B belong to different musical elements under the same element type.
[0081] Step 220: Obtain at least two musical arrangement rules.
[0082] The musical tone adaptation rule is used to adjust the musical elements corresponding to the musical notes in the first musical tone sequence, and there is a matching relationship between the musical tone adaptation rule and the musical elements.
[0083] In some embodiments, a musical note arrangement rule refers to a method for changing musical elements in a first musical note sequence. For example, if the first musical note sequence includes a quarter note a, shortening the quarter note a to obtain an eighth note a changes the note length, thereby changing the performance effect of the first musical note sequence.
[0084] Optionally, the music element includes at least one of a pitch type, a note quantity type, a rhythm type, a chord type, a chord quantity, and the like.
[0085] In the first example, when the element type corresponds to the pitch type, the musical note adaptation rule corresponding to the pitch type is the pitch adaptation rule, which is used to increase or decrease the pitch height corresponding to the note. For example, the first musical note sequence includes the note A, and its corresponding MIDI (Musical Instrument Digital Interface) value is 3. After adding one semitone to it, its MIDI value becomes 4, and the note A1 is obtained. At this time, the pitch height of the note A1 is higher than that of the note A.
[0086] MIDI values are a standard protocol for music creation, performance, and control. In the MIDI system, pitch is represented by MIDI values, which range from 0 to 127. Higher MIDI values indicate higher pitches.
[0087] In the second example, when the element type corresponds to the note quantity type, the musical sound adaptation rule corresponding to the note quantity type is a note addition rule or a note deletion rule, wherein the note addition rule is used to add at least one note between two adjacent notes in the first musical sound sequence, and the note deletion rule is used to delete at least one note from the first musical sound sequence. Optionally, the note addition rule or the note deletion rule is determined according to the user's selection; or, the note addition rule or the note deletion rule is determined according to the adaptation requirements of the music. Schematically, when the adaptation rule is to adapt a piece of pop music into a nursery rhyme style, the music complexity is required to be lower, so the note deletion rule is selected; when the adaptation rule is to adapt a nursery rhyme into pop music, the music complexity is required to be higher, so the note addition rule is selected. It is worth noting that the selection method of the note addition rule or the note deletion rule is only an illustrative example, and the embodiments of the present application do not limit this.
[0088] In the third example, when the element type corresponds to a rhythm type, the musical sound adaptation rule corresponding to the rhythm type is a rhythm adjustment rule, which is used to extend or shorten the duration of a note (ie, the note length).
[0089] In the fourth example, when the element type corresponds to a chord type, the musical tone adaptation rule corresponding to the chord type is a chord adjustment rule, which is used to increase chord notes in the first musical tone sequence.
[0090] Optionally, the music adaptation rules are manually set by music composers; or, the music adaptation rules are obtained by analyzing elements of multiple authorized music clips.
[0091] When the musical arrangement rules are obtained through automatic analysis, they include at least one of the following situations:
[0092] 1. The user selects the style of the music to be adapted. For example, if the style is jazz, the first musical tone sequence is the sequence required to be adapted into a jazz style. Multiple authorized jazz music pieces or jazz music excerpts are obtained, and the pitch, number of notes, rhythm, and chords of the jazz music pieces or jazz music excerpts are analyzed to obtain musical tone adaptation rules for the first musical tone sequence. For example, if the average number of notes in a measure of multiple jazz music pieces is 6, and the number of notes in a measure of the first musical tone sequence is 4, then the musical tone adaptation rules for the first musical tone sequence are determined to include a note addition rule.
[0093] 2. Obtain multiple adapted works and their corresponding original works; perform comparative analysis on the adapted works and the original works to obtain adapted content, and generate musical adaptation rules based on the adapted content.
[0094] It should be noted that the above-mentioned method for determining the music arrangement rules is merely an illustrative example and is not limited in this embodiment.
[0095] Step 230 : Based on the first musical element corresponding to the first musical tone sequence and the matching relationship, determine a first adaptation rule that matches the first musical element from at least two musical tone adaptation rules.
[0096] In some embodiments, a first musical element is determined from at least two musical elements corresponding to the first musical tone sequence, and then a first adaptation rule matching the first musical element is selected from at least two musical tone adaptation rules based on the first musical element and the matching relationship.
[0097] Optionally, the first musical element refers to the first musical elements corresponding to all notes in the first musical tone sequence; or, the first musical element refers to the first musical element corresponding to a specified note in the first musical tone sequence.
[0098] Optionally, the first musical element only includes one musical element corresponding to at least one note in the first musical tone sequence; or, the first musical element includes at least two musical elements corresponding to at least one note in the first musical tone sequence.
[0099] In some embodiments, at least one dimension of the first musical tone sequence to be adapted is first determined to obtain a first musical element. Schematically, when the dimension of the first musical tone sequence to be adapted in the adaptation requirements includes: improving the musical rhythm and improving the pitch, the first musical element includes a pitch element and a rhythm element, and the first musical tone sequence is adapted from the two dimensions of pitch and rhythm.
[0100] Wherein, in determining the first musical element, at least one of the following methods is included: 1. Obtaining the first musical element according to the adaptation dimension selected by the user; 2. Determining at least one dimension to be adapted according to the predetermined adapted style and the style of the first musical tone sequence to obtain the first musical element, wherein the style of the first musical tone sequence is pre-set, or the style of the first musical tone sequence is obtained by analysis and identification; at least one dimension when adapting between different musical styles is pre-set, such as: the adaptation dimension from jazz to pop music includes a rhythm dimension and a chord dimension; 3. Determining at least one dimension to be adapted according to the style of the adapted target music selected by the user and the style of the first musical tone sequence to obtain the first musical element; 4. Determining the first musical element from at least two musical elements according to a random adaptation strategy. The above-mentioned method of determining the first musical element is only an illustrative example, and the embodiments of the present application are not limited to this.
[0101] Illustratively, the first adaptation rule refers to an adaptation rule for changing the first musical element corresponding to the first musical tone sequence.
[0102] Optionally, the first adaptation rule is determined in at least one of the following ways:
[0103] First, matching the first musical element with at least two musical adaptation rules one by one, and selecting a musical adaptation rule with a corresponding matching relationship as a first adaptation rule according to the matching results;
[0104] Illustratively, the first musical element includes a rhythm element, and the at least two musical sound adaptation rules include a pitch adaptation rule, a rhythm adaptation rule, a note addition rule, and a chord adaptation rule. After matching the rhythm element with the at least two musical sound adaptation rules, the rhythm adaptation rule corresponding to the rhythm element is obtained as the first adaptation rule.
[0105] Second, the musical element and the musical sound adaptation rule having a matching relationship are marked with a matching identifier, the matching identifier corresponding to the first musical element is obtained, and the musical sound adaptation rule corresponding to the matching identifier is selected from at least two musical sound adaptation rules as a first adaptation rule based on the matching identifier;
[0106] Schematically, a musical element corresponds to an element identifier, and the music adaptation rule is marked with the element identifier of the corresponding musical element. For example, the element identifier corresponding to the rhythm element is rhy, and the rhythm adaptation rule includes the element identifier rhy. Then, when the first musical element includes the rhythm element, the rhythm adaptation rule marked with the element identifier rhy is obtained as the first adaptation rule.
[0107] Third, the musical elements are respectively pre-set with matching requirements, a first matching requirement corresponding to the first musical element is obtained, at least two musical adaptation rules are matched with the first musical element to obtain a matching result, and the musical adaptation rule corresponding to the first matching requirement that meets the matching result is used as the first adaptation rule.
[0108] In an illustrative manner, the pre-set matching requirements for the music elements correspond to the music theoretical characteristics of the music elements. For example, if the matching requirement corresponding to the rhythm element is a note length change requirement, the note length change in the music adaptation rule is matched with the note length change requirement. If the note length in the rhythm adaptation rule changes and meets the note length change requirement, the rhythm adaptation rule is obtained as the first adaptation rule. If the note length in the note addition / deletion rule also changes and meets the note length change requirement, the rhythm adaptation rule and the note addition / deletion rule are obtained as the first adaptation rule.
[0109] It is worth noting that the above-mentioned method for determining the first reorganization rule is only an illustrative example and is not limited to this embodiment of the present application.
[0110] Optionally, based on the one or at least two musical elements corresponding to the first musical tone sequence and the matching relationship, a musical tone adaptation rule matching the one or at least two musical tone elements is determined.
[0111] Optionally, the first musical element is randomly determined from at least two musical elements corresponding to the first musical tone sequence; or, a musical element in the first musical tone sequence is designated as the first musical element, which is not limited to this.
[0112] Step 240 , performing musical adaptation on the first music element according to the first adaptation rule to obtain an element adjustment result corresponding to the first music element.
[0113] Illustratively, after determining the first adaptation rule according to the first musical element, the first musical element corresponding to the notes in the first musical tone sequence is adapted to obtain an element adjustment result of the first musical element.
[0114] In some embodiments, if the first musical element corresponds to the first musical element corresponding to all notes in the first musical tone sequence, the first musical element corresponding to all notes is musically adapted using the first adaptation rule to obtain adjustment results for the elements corresponding to all notes. For example, the pitch heights corresponding to all notes in the first musical tone sequence are adjusted using the pitch adaptation rule to obtain adjustment results for the pitches corresponding to all notes.
[0115] In some embodiments, if the first musical element corresponds to the first musical element corresponding to a specified note in the first musical tone sequence, the first musical element of the specified note is musically adapted according to the first adaptation rule to obtain a musical adaptation result of the specified note.
[0116] That is, the element adjustment result corresponding to the music element is the element adjustment result corresponding to the note.
[0117] In some embodiments, a first musical element corresponding to a specified note in a first musical tone sequence is determined from at least two musical elements; and a first adaptation rule is obtained from at least two musical tone adaptation rules based on the first musical element and the matching relationship.
[0118] By adapting specific notes in the first musical tone sequence, the adaptation accuracy of the first musical tone sequence can be improved, the granularity of the adaptation of the first musical tone sequence can be reduced, and the first musical tone sequence can be adapted in smaller units, thereby improving the adaptation accuracy of the first musical tone sequence and avoiding the problem that the adaptation result of the first musical tone sequence is relatively stiff due to the large-scale uniform adjustment of all notes.
[0119] Step 250 : generating a second musical tone sequence based on the element adjustment results corresponding to at least two musical elements of the first musical tone sequence.
[0120] Illustratively, after performing musical adaptation on at least two musical elements in the first musical tone sequence using matching musical tone adaptation rules, element adjustment results corresponding to the at least two musical elements are obtained, and the second musical tone sequence is generated based on the at least two element adjustment results.
[0121] The performance effect of the second musical tone sequence is different from the performance effect of the first musical tone sequence.
[0122] In summary, the method provided in this embodiment obtains a first musical tone sequence comprising at least two musical elements and at least two musical tone adaptation rules. Based on the matching relationship between the musical tone adaptation rules and the musical elements, and based on the first musical element corresponding to the first musical tone sequence and the matching relationship, a first adaptation rule matching the first musical element is determined from the at least two musical tone adaptation rules. The first musical element is musically adapted according to the first adaptation rule to obtain an element adjustment result. Finally, a second musical tone sequence is generated based on the element adjustment results corresponding to the at least two musical elements. That is, by presetting at least two musical tone adaptation rules, a first adaptation rule matching the first musical element of the first musical tone sequence is selected to perform musical adaptation on the first musical element of the first musical tone sequence, obtaining an element adjustment result corresponding to the first musical element. Finally, a second musical tone sequence is generated based on the element adjustment results corresponding to the musical elements of the first musical tone sequence. This ensures that the melodic structure of the resulting adapted musical sequence is more complete, the adaptation result conforms to musical theory and aesthetics, and the rationality and effectiveness of the melodic adaptation are improved.
[0123] In an optional embodiment, the adaptation rules are matched by element type. For illustration, please refer to FIG3 , which shows a flow chart of a melody adaptation method provided by an exemplary embodiment of the present application. That is, step 230 further includes steps 231 and 232. As shown in FIG3 , step 230 includes the following steps.
[0124] Step 231: Determine a first musical element corresponding to a designated note from at least two musical elements.
[0125] Illustratively, first, a designated note is determined in a first musical tone sequence, and a first musical element is determined from at least two musical elements corresponding to the designated note.
[0126] The following describes in detail how to obtain the specified note.
[0127] In some embodiments, a position number is randomly generated, indicating the corresponding position of a note in the first musical tone sequence. Based on the position number, the note corresponding to the position number is determined from the first musical tone sequence as the designated note. For example, if the position number is 22, and the first musical tone sequence includes 23 notes arranged in the order in which the melody is played, the penultimate note is designated as the designated note.
[0128] In some embodiments, at least two notes in the first musical tone sequence are analyzed based on an adaptation requirement, and a designated note to be adapted is determined from the at least two notes based on the adaptation requirement. For example, if the adaptation requirement is to adapt the first musical tone sequence into jazz music and the tempo of the first musical tone sequence needs to be accelerated, the at least two notes in the first musical tone sequence are analyzed, and the note with a duration of at least 0.5 seconds is selected as the designated note.
[0129] In some embodiments, a first musical tone sequence is divided to obtain at least two musical tone subsequences, each musical tone subsequence including at least two adjacently arranged notes; a first musical tone subsequence is randomly obtained from the at least two musical tone subsequences, each musical tone subsequence including a specified note; and a first musical element is determined from at least two musical elements corresponding to the specified note.
[0130] By dividing the musical tone subsequences, the musical elements are adapted in units of musical tone subsequences. Within the musical tone subsequences, the uniformity of each musical tone subsequence is improved. Between at least two musical tone subsequences, the adaptation diversity of the first musical tone sequence is improved. When at least two musical tone subsequences are adapted using different adaptation schemes, the differences between different musical tone subsequences are improved, thereby improving the adaptation diversity of the first musical tone sequence.
[0131] In this embodiment, the method for determining the specified note can also be obtained through subsequence division. The first musical tone sequence is divided into subsequences according to a preset number of subsequences to obtain at least two musical tone subsequences corresponding to the number of subsequences, wherein a single musical tone subsequence includes at least two adjacently arranged notes.
[0132] In this embodiment, a musical tone subsequence is randomly determined from at least two musical tone subsequences as a first musical tone subsequence, at least one note is randomly determined from the first musical tone subsequence as a designated note, and at least two musical elements corresponding to the designated note are randomly determined as first musical elements.
[0133] For example, the first musical tone sequence is divided into eight musical tone subsequences, wherein the third musical tone subsequence is used as the first musical tone subsequence, wherein the first musical tone subsequence includes note a, note b and note c, and the pitch height corresponding to note b is used as the first musical element.
[0134] Step 232: Obtain a first adaptation rule from at least two musical adaptation rules based on the first musical element and the matching relationship.
[0135] Illustratively, after obtaining the first musical element, a musical sound adaptation rule corresponding to the first musical element is determined from at least two musical sound adaptation rules according to the first musical element and the matching relationship, as the first adaptation rule.
[0136] Step 240 , performing musical adaptation on the first music element according to the first adaptation rule, and obtaining an element adaptation result corresponding to the element content of the first music element.
[0137] In some embodiments, the melody adaptation method involved in this application is an adaptation method for a vocal melody in a song, and is used to adapt the melody notes of the vocal portion of the song to different feature dimensions and degrees, with the goal of achieving an auditory effect similar to the melody of the original vocal portion of the song, but with differences after the adaptation. In some embodiments, the pitch sequence of the melody of the vocal portion of the song is first identified and extracted as a first musical tone sequence, which also includes the duration corresponding to each pitch. Based on the extracted first musical tone sequence of the melody, a first musical element is adapted to obtain an element adaptation result.
[0138] The following describes in detail the musical arrangement methods of the musical arrangement rules corresponding to different element types.
[0139] The first one is the adaptation process under the pitch type.
[0140] In some embodiments, the first adaptation rule includes a pitch adaptation rule, which is used to adjust the pitch of a note; based on the pitch adaptation rule, a first pitch height corresponding to the first note in the first music sequence is adjusted to obtain a second pitch height corresponding to the first note, and as a result of the element adjustment, the first pitch height is different from the second pitch height.
[0141] Illustratively, when the first musical element includes a pitch, the first adaptation rule is implemented as a pitch adaptation rule corresponding to the pitch type, wherein the pitch adaptation rule is used to raise or lower the pitch of the first note.
[0142] In this embodiment, a first pitch height corresponding to a first note in a first musical tone sequence is first obtained, and the first pitch height corresponding to the first note is raised or lowered according to a pitch adaptation rule to obtain a second pitch height as an element adjustment result. When the pitch adaptation rule is implemented to raise the first pitch height, the second pitch height after pitch adjustment by the pitch adaptation rule is higher than the first pitch height; when the pitch adaptation rule is implemented to lower the first pitch height, the second pitch height after pitch adjustment by the pitch adaptation rule is lower than the first pitch height.
[0143] In some embodiments, a preset pitch adjustment value is obtained; the pitch adjustment value is increased or decreased for a first pitch height to obtain a second pitch height. In some embodiments, the pitch adjustment value is increased or decreased by the first pitch height to obtain a second pitch height. In some embodiments, the pitch adjustment value is added to or subtracted from the first pitch height to obtain the second pitch height; or the pitch adjustment value is multiplied or divided by the first pitch height to obtain the second pitch height.
[0144] In this embodiment, a pitch adjustment value is preset, for example, 2 semitones, and the first pitch height is raised by 2 semitones (i.e., the MIDI value of the second pitch height increases by 2 compared to the first pitch height), or the first pitch height is lowered by 2 semitones (i.e., the MIDI value of the second pitch height decreases by 2 compared to the first pitch height), thereby obtaining the second pitch height. In other words, each semitone corresponds to a MIDI value of 1.
[0145] In this embodiment, the setting range of the pitch adjustment value includes the range corresponding to three semitones higher to three semitones lower, including the first pitch height and the semitone above it (the MIDI value of the original pitch plus 1), the first pitch height and the semitone below it (the MIDI value of the original pitch minus 1), the first pitch height and the two semitones above it (the MIDI value of the original pitch plus 2), and the two semitones below it (the MIDI value of the original pitch minus 2).
[0146] In one optional embodiment, at least two different pitch adjustment values are set. When the first note is implemented as multiple first notes, a pitch adjustment value is randomly selected for each first note to adjust the first pitch height corresponding to the first note, thereby obtaining the second pitch height corresponding to the first note. Alternatively, multiple different pitch adjustment values are set. When the first note is implemented as multiple first notes, a first pitch adjustment value is determined from the multiple different pitch adjustment values, and the first pitch heights of the multiple first notes are uniformly adjusted using the first pitch adjustment value, thereby obtaining the second pitch heights corresponding to the multiple first notes.
[0147] Schematically, please refer to Figure 4, which shows a schematic diagram of the pitch adjustment process provided by an exemplary embodiment of the present application. As shown in Figure 4, the first musical tone sequence 410 is currently displayed. The first musical tone sequence 410 includes a first note 411, a first note 412, a first note 413 and a first note 414. By raising the first note 411 by a semi-tone, lowering the first note 412 by a semi-tone, lowering the first note 413 by a semi-tone and lowering the first note 414 by a semi-tone, the element adjustment result 420 after pitch adaptation is obtained.
[0148] In some embodiments, a plurality of different pitch adjustment values are set, and based on the adaptation requirements of the first musical tone sequence, a pitch adjustment value for the adaptation of the first note is determined from the plurality of different pitch adjustment values. For example, if the adaptation requirements include adapting a pop song into a folk song style, the pitch adjustment value is determined to be raised by three semitones.
[0149] By adapting the pitches of the notes in the first musical tone sequence, the first musical tone sequence can be switched between different musical styles, thereby improving the adaption flexibility of the first musical tone sequence.
[0150] The second type is the adaptation process under the note number type.
[0151] In some embodiments, the first adaptation rule includes a note addition rule, which is used to indicate adding a passing note between two adjacent notes; obtaining the second note and the third note arranged adjacently in the first musical tone sequence, and obtaining the passing note; adding the passing note between the second note and the third note, and obtaining the note addition result as the element adjustment result.
[0152] In some embodiments, the note adding rule may also be used to instruct adding a note at the start position or the end position of the first musical tone sequence.
[0153] In this embodiment, when the element type is a passing note type, the first adaptation rule is implemented as a note adding process, that is, a passing note is added between two adjacent notes in the first musical tone sequence, thereby playing a transition role between the two notes during the playback of the adapted second musical tone sequence.
[0154] Optionally, the passing sound includes at least one of a transitional sound, an ornamental sound, a transposed sound or a repeated sound.
[0155] Optionally, the passing tone includes at least one of a whole tone or a half tone.
[0156] In this embodiment, the second and third notes to be adapted are first determined from a first musical tone sequence, where the second and third notes are adjacent notes in the first musical tone sequence. Furthermore, a passing note is pre-acquired. The passing note is added between the second and third notes, and a note addition result is obtained as an element adjustment result.
[0157] Schematically, please refer to Figure 5, which shows a schematic diagram of the note adding process provided by an exemplary embodiment of the present application. As shown in Figure 5, a first musical note sequence 510 is displayed, which includes a second note 511 and a third note 512, and a passing note 513 is added between the second note 511 and the third note 512, thereby obtaining an element adjustment result 520.
[0158] In some embodiments, when the pitch heights of the second note and the third note are different, a note with a pitch height between the second note and the third note is obtained as a passing note; or, a preset passing note is obtained; or, the pitch height of the second note is adjusted by a preset adjustment amplitude to obtain a passing note; or, the pitch height of the third note is adjusted by a preset adjustment amplitude to obtain a passing note.
[0159] In some embodiments, at least two notes in the first musical tone sequence are traversed, and two adjacent notes that meet the interval requirement in rhythm are obtained as the second note and the third note.
[0160] It is worth noting that the second note and the first note can be the same note or different notes; or the third note and the first note can be the same note or different notes.
[0161] In some embodiments, the first adaptation rule includes a note deletion rule, which is used to instruct to delete notes in the first musical tone sequence to obtain an element adjustment result.
[0162] In some embodiments, when the first adaptation rule includes a note deletion rule, notes that meet the deletion requirement are determined from the first musical tone sequence according to the note deletion rule, and the notes that meet the deletion requirement are deleted from the first musical tone sequence. For example, if the adaptation requirement is to adapt a pop song into a nursery rhyme, the first adaptation rule includes a note deletion rule that selects notes with a pitch above a pitch threshold as meeting the deletion requirement; or selects notes with a duration less than a preset duration threshold as meeting the deletion requirement.
[0163] By adding or deleting notes from the first musical tone sequence, the first musical tone sequence is adapted into a more complex musical tone sequence or a less complex musical tone sequence, thereby increasing the diversity of musical tone sequence adaptations. Furthermore, by adding a passing note between two adjacent notes in the first musical tone sequence, the smoothness of the transition between the two adjacent notes is improved. By deleting notes from the first musical tone sequence, the complexity of the first musical tone sequence is reduced, making it more suitable for expressing musical styles such as nursery rhymes, thereby increasing the diversity of musical tone sequence adaptations.
[0164] The third type is the adaptation process under the rhythm type.
[0165] In some embodiments, the first adaptation rule includes a rhythm adjustment rule, which is used to adjust the length of the notes; determine the fourth note in the first musical tone sequence, the fourth note corresponding to the first note length; obtain a length adjustment parameter based on the rhythm adjustment rule; adjust the first note length based on the length adjustment parameter to obtain a second note length corresponding to the fourth note, and as an element adjustment result, the second note length is different from the first note length.
[0166] In this embodiment, when the element type is a rhythm type, the first adaptation rule is implemented as a rhythm adjustment rule, which is used to adjust the note length corresponding to the fourth note in the first musical tone sequence.
[0167] In this embodiment, a fourth note in a first musical tone sequence for rhythm adjustment is first determined, a first duration of the fourth note in the first musical tone sequence is obtained, a duration adjustment parameter is obtained, and the first duration is extended or shortened according to the duration adjustment parameter, thereby obtaining an adjusted second duration as an element adjustment result. When the first duration is extended according to the duration adjustment parameter, the second duration is longer than the first duration; when the first duration is shortened according to the duration adjustment parameter, the second duration is shorter than the first duration.
[0168] In this embodiment, the fourth note and the first note length corresponding to the fourth note are first determined, for example, the fourth note is a quarter note, and then the duration adjustment multiple is obtained, for example, 2 times. Therefore, if the first note length of the fourth note is shortened by the duration adjustment multiple, an eighth note is obtained; if the duration of the fourth note is extended by the duration adjustment multiple, a half note is obtained.
[0169] In some optional cases, the first tone length can be iteratively adjusted multiple times using the tone length adjustment parameter, and the result obtained by the last adjustment is used as the second tone length.
[0170] For illustration, please refer to Figure 6, which shows a schematic diagram of the rhythm adjustment process provided in an exemplary embodiment of the present application. As shown in Figure 6, the first musical tone sequence 610 is currently displayed, the fourth note 611 in the first musical tone sequence is determined, the duration adjustment multiple is obtained, and the length of the fourth note 611 is amplified by the duration adjustment multiple to obtain the amplified fourth note 612, wherein the length of the fourth note 612 is twice that of the fourth note 611.
[0171] In other embodiments, a first rhythm type is obtained based on a rhythm adjustment rule, and the first rhythm type includes the sound lengths corresponding to at least two fourth notes respectively; based on the first rhythm type, the sound lengths corresponding to at least two fourth notes in the first musical tone sequence are adjusted to obtain an element adjustment result.
[0172] In this embodiment, the note lengths corresponding to multiple fourth notes are first obtained to set the length adjustment parameters, and the lengths corresponding to multiple fourth notes are uniformly adjusted using the length adjustment parameters to obtain the adjusted lengths of multiple fourth notes, which are used as the element adjustment results.
[0173] In some embodiments, in the rhythm type, the original rhythm of the first musical tone sequence is split, and the rhythm of the first musical tone sequence is rewritten by doubling or multiplying the duration of each note. For example, if the duration of a quarter note is reduced by a factor of two, a new eighth note or sixteenth note may be obtained; and if the duration of a quarter note is multiplied by a factor of two, a new half note or whole note may be obtained.
[0174] By adjusting the duration of the notes in the first musical tone sequence, the first musical tone sequence is adapted into a lighter or more melodious tune style, and the adaptation can be switched between fast and slow tempos, thereby improving the adaptation diversity and flexibility of the first musical tone sequence.
[0175] The fourth type is the adaptation process under chord type.
[0176] In some embodiments, the first musical tone sequence includes a main melody sequence and an accompaniment sequence, the accompaniment sequence includes at least two chord notes, the first adaptation rule includes a chord adjustment rule, and the chord adjustment rule is used to adjust the chord notes; the adjacent first chord note and second chord note in the accompaniment sequence are obtained, and the auxiliary chord note is obtained; the auxiliary chord note is added between the first chord note and the second chord note as the element adjustment result.
[0177] Illustratively, the first musical tone sequence includes a main melody line and an accompaniment line, so the main melody line corresponds to the main melody sequence, and the accompaniment line corresponds to the accompaniment sequence.
[0178] Wherein, when the accompaniment sequence includes multiple chord notes, the first adaptation rule is implemented as a chord adjustment rule corresponding to the chord type, which is used to add a new chord note between two adjacent chord notes.
[0179] In this embodiment, first, a first chord note and a second chord note are obtained in the accompaniment sequence, wherein the first chord note and the second chord note are in adjacent positions in the accompaniment sequence, and a preset auxiliary chord note is obtained, and the auxiliary chord note is added between the first chord note and the second chord note, thereby obtaining an element adjustment result.
[0180] Schematically, please refer to Figure 7, which shows a schematic diagram of the chord adjustment process provided by an exemplary embodiment of the present application. As shown in Figure 7, a main melody sequence 710 and an accompaniment sequence 720 are displayed, wherein the accompaniment sequence 720 includes a first chord note 721 and a second chord note 722, and a pre-set auxiliary chord note 723 is added between the first chord note 721 and the second chord note 722, thereby obtaining an element adjustment result 730.
[0181] In some embodiments, the auxiliary chord note is a pre-set chord note corresponding to the first chord note, and is used to be added after the first chord note; or, the auxiliary chord note is a pre-set chord note corresponding to the second chord note, and is used to be added before the second chord note; or, the auxiliary chord note is a pre-set chord note corresponding to the first chord note and the second chord note, and is used to transition between the first chord note and the second chord note. In some embodiments, the chord rhythm of the first chord note and the second chord note is kept unchanged, and an auxiliary chord note is added between the first chord note and the second chord note, that is, the first interval duration between the first chord note and the second chord note remains unchanged. After the auxiliary chord note is added, the second interval duration between the first chord note and the auxiliary chord note plus the third interval duration between the auxiliary chord note and the second chord note equals the first interval duration. Alternatively, in some embodiments, the second chord note is placed at the end, and the auxiliary chord note is added in the middle with the first interval duration between the first chord note and the second chord note as the interval unit. That is, after the auxiliary chord note is added between the first chord note and the second chord note, the interval between the first chord note and the auxiliary chord note is the first interval duration, and the interval between the auxiliary chord note and the second chord note is the first interval duration, so that the interval duration between the first chord note and the second chord note after the adaptation is twice the first interval duration.
[0182] By adding auxiliary chord notes to the first musical tone sequence and increasing the combination of chords in the first musical tone sequence, the adaptation diversity of the first musical tone sequence is improved.
[0183] In summary, the method provided in this embodiment obtains a first musical tone sequence comprising multiple musical elements and multiple musical tone adaptation rules. Based on the matching relationship between the musical tone adaptation rules and the musical elements, and based on the first musical element corresponding to the first musical tone sequence and the matching relationship, a first adaptation rule that matches the first musical element is determined from the multiple musical tone adaptation rules. The first musical element is musically adapted according to the first adaptation rule to obtain an element adjustment result. Finally, a second musical tone sequence is generated based on the element adjustment results corresponding to the multiple musical elements. That is, by presetting multiple musical tone adaptation rules, a first adaptation rule that matches the first musical element of the first musical tone sequence is selected to perform musical adaptation on the first musical element of the first musical tone sequence, obtaining an element adjustment result corresponding to the first musical element. Finally, a second musical tone sequence is generated based on the element adjustment results corresponding to the musical elements of the first musical tone sequence. This makes the melodic structure of the finally adapted musical sequence more complete, the adaptation result conforms to musical theory and aesthetics, improves the rationality of the melody adaptation, and enhances the melody adaptation effect.
[0184] In an optional embodiment, the melody processing method is described in detail in the music creation scenario. Schematically, please refer to FIG8 , which shows a flow chart of the melody processing method provided by an exemplary embodiment of the present application. As shown in FIG8 , the method includes the following steps.
[0185] Step 810: Acquire a first musical tone sequence.
[0186] First, a first musical tone sequence is obtained after obtaining authorization. The first musical tone sequence includes multiple notes arranged in a melody playback order, each note corresponding to multiple different musical elements. In some embodiments, each note corresponds to musical elements such as pitch and duration. The first musical tone sequence also includes musical elements such as the number of notes and chord type.
[0187] Step 820: Divide the processing units.
[0188] The first musical tone sequence is divided into subsequences to obtain a plurality of sub-musical tone sequences, and each sub-musical tone sequence is used as a processing unit.
[0189] In some embodiments, the gap duration is calculated based on the start and end time between adjacent notes. Notes with consecutive gaps of less than 0.1 seconds are considered a single processing unit, ultimately dividing the entire song into multiple different processing units. A consecutive gap of less than 0.1 seconds means that the gap between two consecutive notes is less than 0.1 seconds among multiple consecutive notes. If the gap between a second note following a first note and the first note is greater than 0.1 seconds, the first note is the last note in the resulting processing unit, and the second note is the starting note in the resulting processing unit.
[0190] The processing unit is implemented as the musical tone subsequence mentioned in the above embodiment.
[0191] Step 830 , process each note in each processing unit.
[0192] Each processing unit includes at least two notes. The musical elements of each note in the processing unit are adjusted by selecting a musical arrangement rule corresponding to the musical elements of the notes. When adjusting the musical elements of each note, each note in the processing unit is traversed. For each traversed note, a determination is made as to whether the musical element needs to be adjusted. If adjustment is required, the musical element of the note is adjusted.
[0193] The adjustment method for the note includes at least one of the following four adjustment methods.
[0194] Step 831, adjust the pitch height.
[0195] By presetting the pitch adjustment value, the pitch adjustment value of at least one note in the processing unit is randomly increased or decreased. In some embodiments, in the pitch sequence of each processing unit, different adaptation techniques are randomly performed on the notes, and a certain pitch ratio is kept unchanged to ensure similarity.
[0196] Step 832, add passing sound.
[0197] A first note and a second note arranged adjacently in a processing unit are obtained, and a passing note is added between the first note and the second note.
[0198] Step 833: Adjust the rhythm type.
[0199] By pre-setting the duration adjustment parameters, the duration of each note in the processing unit is adjusted.
[0200] Step 834, insert chord notes.
[0201] When the processing unit is an accompaniment sequence, the first chord note and the second chord note adjacent to each other in the processing unit are obtained, and the target chord note is added between the first chord note and the second chord note.
[0202] In summary, the method provided in this embodiment obtains a first musical tone sequence comprising multiple musical elements and multiple musical tone adaptation rules. Based on the matching relationship between the musical tone adaptation rules and the musical elements, and based on the first musical element corresponding to the first musical tone sequence and the matching relationship, a first adaptation rule that matches the first musical element is determined from the multiple musical tone adaptation rules. The first musical element is musically adapted according to the first adaptation rule to obtain an element adjustment result. Finally, a second musical tone sequence is generated based on the element adjustment results corresponding to the multiple musical elements. That is, by presetting multiple musical tone adaptation rules, a first adaptation rule that matches the first musical element of the first musical tone sequence is selected to perform musical adaptation on the first musical element of the first musical tone sequence, obtaining an element adjustment result corresponding to the first musical element. Finally, a second musical tone sequence is generated based on the element adjustment results corresponding to the musical elements of the first musical tone sequence. This makes the melodic structure of the finally adapted musical sequence more complete, the adaptation result conforms to musical theory and aesthetics, improves the rationality of the melody adaptation, and enhances the melody adaptation effect.
[0203] The beneficial effects of this application include at least:
[0204] 1. This application splits the original melody and rhythm to give the song a different rhythmic feel;
[0205] 2. This application adds passing notes to the original melody notes, enriching the pitch connection of the original melody and smoothing the melody line;
[0206] 3. This application adds passing chords to the chord progression corresponding to the original song's melody, enriching the song's harmonic direction;
[0207] 4. This application has amplified the color of the chords corresponding to the melody of the original song. After changing to the replacement chords, the melody pitch has richer changes.
[0208] Please refer to FIG9 , which shows a structural block diagram of a melody adaptation device provided by an exemplary embodiment of the present application. The device includes the following modules:
[0209] An acquisition module 910 is configured to acquire a first musical tone sequence, wherein the first musical tone sequence includes at least two notes arranged in a melody playback order, wherein the notes correspond to at least two musical elements;
[0210] The acquisition module 910 is further configured to acquire at least two musical tone adaptation rules, wherein the musical tone adaptation rules are used to adjust the musical elements corresponding to the notes in the first musical tone sequence, and the musical tone adaptation rules have a matching relationship with the musical elements;
[0211] a determination module 920 for determining, based on the first musical element in the first musical tone sequence and the matching relationship, a first adaptation rule that matches the first musical element from the at least two musical tone adaptation rules;
[0212] An adaptation module 930 is configured to adapt the first music element according to the first adaptation rule to obtain an element adjustment result corresponding to the first music element;
[0213] The generating module 940 is configured to generate a second musical tone sequence based on the element adjustment results corresponding to the at least two musical elements of the first musical tone sequence.
[0214] In some embodiments, the determination module 920 is configured to determine, from the at least two musical elements, a first musical element corresponding to a specified note in a first musical tone sequence; and obtain the first adaptation rule from the at least two musical tone adaptation rules based on the first musical element and the matching relationship.
[0215] In some embodiments, the determination module 920 is used to divide the first musical sound sequence to obtain at least two musical sound subsequences, each of which includes at least two adjacently arranged notes; obtain a first musical sound subsequence from the at least two musical sound subsequences, each of which includes the specified note; and determine the first musical element from the musical elements corresponding to the specified note.
[0216] In some embodiments, the first adaptation rule comprises a pitch adaptation rule, wherein the pitch adaptation rule is used to adjust the pitch of the note;
[0217] The adaptation module 930 is used to adjust the first pitch height corresponding to the first note in the first music sequence based on the pitch adaptation rule to obtain the second pitch height corresponding to the first note, as the element adjustment result, the first pitch height is different from the second pitch height.
[0218] In some embodiments, the adaptation module 930 is configured to obtain a preset pitch adjustment value; and to increase or decrease the first pitch height by using the pitch adjustment value as an adjustment amplitude to obtain the second pitch height.
[0219] In some embodiments, the first adaptation rule includes a note adding rule, wherein the note adding rule is used to instruct to add a passing note between two adjacent notes;
[0220] The adaptation module 930 is used to obtain the second note and the third note arranged adjacently in the first musical tone sequence, and to obtain the passing tone note; and to add the passing tone note between the second note and the third note to obtain a note addition result as the element adjustment result.
[0221] In some embodiments, the adaptation module 930 is used to obtain a note with a pitch between the second note and the third note as the passing note when the second note and the third note have different pitches; or, to obtain a preset passing note; or, to adjust the pitch of the second note by a preset adjustment amplitude to obtain the passing note; or, to adjust the pitch of the third note by a preset adjustment amplitude to obtain the passing note.
[0222] In some embodiments, the adaptation module 930 is configured to traverse at least two notes in the first musical tone sequence; and obtain two adjacent notes from the at least two notes that meet the interval requirement in rhythm as the second note and the third note.
[0223] In some embodiments, the first adaptation rule includes a rhythm adjustment rule, wherein the rhythm adjustment rule is used to adjust the duration of a note;
[0224] The adaptation module 930 is used to determine the fourth note in the first musical tone sequence, where the fourth note corresponds to a first tone length; obtain a tone length adjustment parameter based on the rhythm adjustment rule; and adjust the first tone length based on the tone length adjustment parameter to obtain a second tone length corresponding to the fourth note, where the second tone length is different from the first tone length as the element adjustment result.
[0225] In some embodiments, the adaptation module 930 is used to obtain a first rhythm type based on the rhythm adjustment rule, wherein the first rhythm type includes the sound lengths corresponding to at least two notes respectively; and adjust the sound lengths corresponding to the at least two notes in the first musical tone sequence based on the first rhythm type to obtain the element adjustment result.
[0226] In some embodiments, the first musical tone sequence includes an accompaniment sequence, the accompaniment sequence includes at least two chord notes, and the first adaptation rule includes a chord adjustment rule, the chord adjustment rule being used to adjust the chord notes;
[0227] The adapting module 930 is configured to obtain adjacent first and second chord notes in the accompaniment sequence, as well as auxiliary chord notes; and add the auxiliary chord notes between the first and second chord notes as the element adjustment result.
[0228] In summary, when a first musical tone sequence including multiple musical elements and multiple musical tone adaptation rules is obtained, according to the matching relationship between the musical tone adaptation rules and the musical elements, according to the first musical element corresponding to the first musical tone sequence and the matching relationship, a first adaptation rule that matches the first musical element is determined from the multiple musical tone adaptation rules, and the first musical element is musically adapted according to the first adaptation rule to obtain an element adjustment result, and finally a second musical tone sequence is generated according to the element adjustment results corresponding to the multiple musical elements. That is, by presetting multiple musical tone adaptation rules, according to the correspondence of the first musical element of the first musical tone sequence, the first adaptation rule that matches it is selected to perform musical adaptation on the first musical element of the first musical tone sequence, and the element adjustment result corresponding to the first musical element is obtained, and finally a second musical tone sequence is generated according to the element adjustment results corresponding to the musical elements of the first musical tone sequence, so that the melody structure of the finally adapted musical sequence is more complete, the adaptation result conforms to the musical theory and aesthetics, the rationality of the melody adaptation is improved, and the melody adaptation effect is enhanced.
[0229] It should be noted that the melody arrangement device provided in the above embodiment is merely illustrated by the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be distributed among different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the melody arrangement device provided in the above embodiment and the melody arrangement method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0230] Figure 10 shows a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application, which specifically includes the following structure.
[0231] The server 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory (RAM) 1002 and a read-only memory (ROM) 1003, and a system bus 1005 connecting the system memory 1004 and the CPU 1001. The server 1000 also includes a mass storage device 1006 for storing an operating system 1013, application programs 1014, and other program modules 1015.
[0232] The mass storage device 1006 is connected to the central processing unit 1001 via a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1006 and its associated computer-readable media provide non-volatile storage for the server 1000. That is, the mass storage device 1006 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0233] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data.
[0234] According to various embodiments of the present application, the server 1000 may also be connected to a remote computer on a network such as the Internet for operation. That is, the server 1000 may be connected to the network 1012 via the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 may be used to connect to other types of networks or remote computer systems (not shown).
[0235] The memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU.
[0236] Embodiments of the present application also provide a computer device comprising a processor and memory, wherein the memory stores at least one instruction, at least one program, code set, or instruction set, and the processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the melody arrangement methods provided in the above-described method embodiments. Optionally, the computer device may be a terminal or a server.
[0237] An embodiment of the present application further provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the melody adaptation methods provided in the above-mentioned method embodiments.
[0238] Embodiments of the present application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the melody adaptation method described in any of the above embodiments.
[0239] Optionally, the computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid-state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0240] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0241] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A melody adaptation method, executed by a computer device, the method comprising: Acquire a first musical tone sequence, wherein the first musical tone sequence includes at least two notes arranged in a melody playing order, and the notes correspond to at least two musical elements; Acquire at least two musical sound adaptation rules, wherein the musical sound adaptation rules are used to adjust the musical elements corresponding to the musical notes in the first musical sound sequence, and the musical sound adaptation rules and the musical elements have a matching relationship; Based on a first music element in the first music tone sequence and the matching relationship, determining a first adaptation rule matching the first music element from the at least two music tone adaptation rules; Adapting the first music element according to the first adaptation rule to obtain an element adjustment result corresponding to the first music element; A second musical tone sequence is generated based on element adjustment results respectively corresponding to at least two musical elements of the first musical tone sequence.
2. The method according to claim 1, wherein: The step of determining a first adaptation rule matching the first music element from the at least two music adaptation rules based on the first music element in the first music sequence and the matching relationship comprises: Determine a first musical element corresponding to a designated note in the first musical tone sequence from the at least two musical elements; The first adaptation rule is acquired from the at least two musical sound adaptation rules based on the first music element and the matching relationship.
3. The method according to claim 2, wherein: The step of determining the first musical element corresponding to the designated note in the first musical tone sequence from the at least two musical elements comprises: Dividing the first musical tone sequence to obtain at least two musical tone subsequences, each musical tone subsequence including at least two adjacently arranged notes; Acquire a first musical sound subsequence from the at least two musical sound subsequences, wherein the first musical sound subsequence includes the designated note; The first musical element is determined from the musical elements corresponding to the designated note.
4. The method according to any one of claims 1 to 3, wherein: The first adaptation rule comprises a pitch adaptation rule, and the pitch adaptation rule is used to adjust the pitch of the note; The adapting the first music element according to the first adapting rule to obtain an element adjustment result corresponding to the first music element includes: The first pitch height corresponding to the first note in the first music sequence is adjusted based on the pitch adaptation rule to obtain the second pitch height corresponding to the first note. As the element adjustment result, the first pitch height is different from the second pitch height.
5. The method according to any one of claims 1 to 4, wherein: The step of adjusting the first pitch height corresponding to the first note in the first music sequence based on the pitch adaptation rule to obtain the second pitch height corresponding to the first note includes: Get the preset pitch adjustment value; The first pitch height is increased or decreased by using the pitch adjustment value as an adjustment amplitude to obtain the second pitch height.
6. The method according to any one of claims 1 to 5, wherein: The first adaptation rule includes a note adding rule, and the note adding rule is used to indicate adding a passing note between two adjacent notes; The adapting the first music element according to the first adapting rule to obtain an element adjustment result corresponding to the first music element includes: Acquire the second note and the third note that are arranged adjacently in the first musical tone sequence, and acquire the passing tone note; The passing note is added between the second note and the third note to obtain a note adding result as the element adjustment result.
7. The method according to claim 6, wherein: The step of obtaining the passing note includes: In the case where the second note and the third note have different pitches, a note with a pitch between the second note and the third note is obtained as the passing note; or, Obtaining the preset passing tone note; or, Adjust the pitch of the second note by a preset adjustment amplitude to obtain the passing note; or, The pitch height of the third note is adjusted with a preset adjustment amplitude to obtain the passing note.
8. The method according to claim 6 or 7, wherein: The step of obtaining the second note and the third note arranged adjacently in the first musical tone sequence comprises: Traversing at least two notes in the first musical tone sequence; Two notes that are adjacent to each other and meet the interval requirement in rhythm among the at least two notes are obtained as the second note and the third note.
9. The method according to any one of claims 1 to 8, wherein: The first adaptation rule includes a rhythm adjustment rule, and the rhythm adjustment rule is used to adjust the length of the notes; The adapting the first music element according to the first adapting rule to obtain an element adjustment result corresponding to the first music element includes: Determine a fourth note in the first musical tone sequence, wherein the fourth note corresponds to the first tone length; Acquiring a tone length adjustment parameter based on the rhythm adjustment rule; The first tone length is adjusted based on the tone length adjustment parameter to obtain a second tone length corresponding to the fourth note, and as the element adjustment result, the second tone length is different from the first tone length.
10. The method according to claim 9, wherein: The method further comprises: Acquire a first rhythm type based on the rhythm adjustment rule, wherein the first rhythm type includes the lengths of at least two notes respectively corresponding to each other; The tone lengths respectively corresponding to the at least two notes in the first musical tone sequence are adjusted based on the first rhythm type to obtain the element adjustment result.
11. The method according to any one of claims 1 to 10, wherein: The first musical tone sequence includes an accompaniment sequence, the accompaniment sequence includes at least two chord notes, the first adaptation rule includes a chord adjustment rule, and the chord adjustment rule is used to adjust the chord notes; The adapting the first music element according to the first adapting rule to obtain an element adjustment result corresponding to the first music element includes: Acquire the adjacent first chord note and second chord note in the accompaniment sequence, and acquire the auxiliary chord note; The auxiliary chord note is added between the first chord note and the second chord note as the element adjustment result.
12. A melody adaptation device, comprising: An acquisition module, used for acquiring a first musical tone sequence, wherein the first musical tone sequence includes at least two notes arranged in a melody playing order, and the notes correspond to at least two musical elements; The acquisition module is further used to acquire at least two musical sound adaptation rules, wherein the musical sound adaptation rules are used to adjust the musical elements corresponding to the notes in the first musical sound sequence, and there is a matching relationship between the musical sound adaptation rules and the musical elements; a determination module, configured to determine, based on a first music element in the first music sequence and the matching relationship, a first adaptation rule matching the first music element from the at least two music adaptation rules; an adaptation module, configured to adapt the first music element according to the first adaptation rule to obtain an element adjustment result corresponding to the first music element; A generating module is used to generate a second musical tone sequence based on element adjustment results respectively corresponding to at least two musical elements of the first musical tone sequence.
13. A computer device, comprising a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the melody adaptation method according to any one of claims 1 to 11.
14. A computer-readable storage medium, wherein at least one program is stored in the storage medium, and the at least one program is loaded and executed by a processor to implement the melody adaptation method according to any one of claims 1 to 11.
15. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the melody adaptation method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Method and device for generating MIDI music according to notes
CN101800046A
Automatic composition method and device, computer device, and storage medium
CN109036355A
Multi-audio-track sequence generation method, device and equipment and storage medium
CN109616090A
Audio processing method and device, computing equipment and medium
CN112992110A
Music work generation method and device thereof, music work synthesis method and device, equipment, medium and product
CN113611268A