Music Texture Generation Method, Device, Electronic Device and Storage Medium

Generating music textures through Markov chain algorithm solves the problem of lack of diversity and music theory errors in the existing technology, realizing user-friendly music creation assistance, and improving creative efficiency and diversity.

CN115035884BActive Publication Date: 2025-08-01BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210604599.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2025-08-01
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

The prior art lacks diversity in the generation of musical fabrics and is prone to music theory errors, making it difficult to meet the diverse needs and creative requirements of users.

Method used

The Markov chain algorithm is used to perform probability sampling of music scores to generate numbering sequences, and dynamically adjust the numbering sequences to generate music textures, combining music theory rules and habits to improve creative efficiency.

Benefits of technology

Through the Markov chain algorithm, music textures can be generated, and users can make flexibly adjustments according to their needs, improve the efficiency and diversity of music creation, and reduce music theory errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115035884B_ABST
    Figure CN115035884B_ABST
Patent Text Reader

Abstract

The present application provides a method, apparatus, electronic device and storage medium for generating a musical texture. Among them, the method includes: receiving a musical score; performing sampling processing on the musical score by using a Markov chain algorithm, and generating a numbered sequence corresponding to the musical score according to the sampling result; receiving input adjustment data, and adjusting the numbered sequence according to the adjustment data to obtain an adjusted numbered sequence; generating a musical texture according to the adjusted numbered sequence. In this way, it is possible to probabilistically collect the notes contained in the musical score by using a Markov chain to generate a corresponding numbered sequence, so that the user can dynamically adjust and generate according to common music theory rules and habits based on the numbered sequence generated by the Markov chain, which can assist the user in music creation and improve the efficiency of music creation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular, to a method, device, electronic device, and storage medium for generating musical textures. Background Art

[0002] The creation of musical textures is one of the most important aspects in music accompaniment production. For a long time, researchers have conducted many explorations on how to use computers to assist in creating and automatically generating musical textures.

[0003] In the prior art, some musical textures are generated through templates or fixed patterns, which lack diversity; some use certain technical generation means to generate musical textures based on refined composition experience, and the styles generated by this method vary greatly and are prone to musical theory errors and lack stability. Summary of the Invention

[0004] In view of this, the purpose of this application is to propose a method, device, electronic device, and storage medium for generating musical textures to solve or partially solve the above technical problems.

[0005] Based on the above purpose, the first aspect of this application provides a method for generating musical textures, including:

[0006] Receiving a musical score; <*

[0007] Using the Markov chain algorithm to sample the musical score, and generating a numbered sequence corresponding to the musical score according to the sampling result;

[0008] Receiving input adjustment data, and adjusting the numbered sequence according to the adjustment data to obtain an adjusted numbered sequence;

[0009] Generating a musical texture according to the adjusted numbered sequence.

[0010] In some embodiments, before using the Markov chain algorithm to sample the musical score, it includes:

[0011] Receiving the set parameter values of the Markov chain, and determining the Markov chain algorithm according to the parameter values.

[0012] In some embodiments, the parameter values of the Markov chain include at least one of the following:

[0013] The number of notes N, the note density D, the note expansion range of the note numbers, and the maximum number of notes at the same time.

[0014] In some embodiments, the using the Markov chain algorithm to sample the musical score, and generating a numbered sequence corresponding to the musical score according to the sampling result, includes:

[0015] Sample the note distribution data in the music score based on the parameter values in the Markov chain algorithm to determine the first probability distribution of note time points, the second probability distribution of note numbers, and the third probability distribution of multiple voices corresponding to the note time points, where each voice in the multiple voices corresponds to a note.

[0016] Superimpose the first probability distribution, the second probability distribution, and the third probability distribution to generate the number sequence corresponding to the music score.

[0017] In some embodiments, the determination process of the first probability distribution includes:

[0018] Determine the initial first probability distribution, where the corresponding values of each time point in the initial first probability distribution form a uniform distribution.

[0019] According to the note time distribution in the music score, sample the initial first probability distribution N×D times to obtain the first probability distribution.

[0020] In some embodiments, the sampling the initial first probability distribution N×D times to obtain the first probability distribution includes:

[0021] After each sampling, the probability distribution of the remaining time points in the initial first probability distribution changes accordingly according to a preset rule, where the preset rule is a preset pitch change rule.

[0022] After determining that all N×D samplings are completed, use the final initial first probability distribution as the first probability distribution.

[0023] In some embodiments, the determination process of the second probability distribution includes:

[0024] Obtain the corresponding time points in the first probability distribution.

[0025] According to the music score, determine the probability of the note number corresponding to each time point, where the note number corresponding to each time point is within the note expansion range.

[0026] Integrate the probability distributions of all time points to obtain the second probability distribution.

[0027] In some embodiments, the determination process of the third probability distribution includes:

[0028] Obtain the corresponding time points in the first probability distribution, and determine the time points T with notes from the time points.

[0029] Determine the probability P of polyphonic notes at each time point T according to the music score, and integrate all the obtained note probabilities P to obtain the third probability distribution.

[0030] In some embodiments, the determining the probability P of polyphonic notes at each time point T according to the music score includes:

[0031] In response to determining that there are polyphonies at time point T' according to the music score, sample the note probabilities P of the notes corresponding to each voice at the time point T', and set the sampled note probabilities of the voice corresponding notes to zero values.

[0032] In some embodiments, the adjusting the number sequence according to the adjustment data to obtain an adjusted number sequence includes:

[0033] In response to determining that the adjustment data belongs to the set parameter data, adjust the number sequence according to the parameter data to obtain an adjusted number sequence;

[0034] In response to determining that the adjustment data belongs to the music style, retrieve the parameter data corresponding to the music style from the storage database, and adjust the number sequence according to the parameter data to obtain an adjusted number sequence.

[0035] In some embodiments, the generating a music texture according to the adjusted number sequence includes:

[0036] Generate corresponding note intensity data from the adjusted number sequence according to a uniform distribution function or a sine variation function;

[0037] Determine the music texture according to all the note intensity data corresponding to the adjusted number sequence.

[0038] In some embodiments, the determining the music texture according to all the note intensity data corresponding to the adjusted number sequence includes:

[0039] Increase the note intensity data of the first beat in all the note intensity data by a predetermined intensity value;

[0040] Add or subtract a random number within a predetermined intensity range to each note intensity data to obtain the music texture.

[0041] Based on the same inventive concept, a second aspect of the present application proposes a music texture generating device, including:

[0042] A receiving module, configured to receive a music score;

[0043] A Markov chain processing module, configured to sample the music score by using a Markov chain algorithm, and generate a number sequence corresponding to the music score according to the sampling result;

[0044] An adjustment module, configured to receive input adjustment data, and adjust the number sequence according to the adjustment data to obtain an adjusted number sequence;

[0045] A texture generation module, configured to generate a music texture according to the adjusted number sequence.

[0046] Based on the same inventive concept, a third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in the first aspect is implemented.

[0047] Based on the same inventive concept, a fourth aspect of the present application provides a non-transitory computer-readable storage medium, which stores computer instructions for causing a computer to execute the method described in the first aspect.

[0048] As can be seen from the above, the music texture generation method, device, electronic device, and storage medium provided by the present application can perform probability acquisition on the notes included in the music score by using a Markov chain, generate a corresponding number sequence, so that the user can dynamically adjust and generate according to common music theory rules and habits through the number sequence generated by the Markov chain, which can assist the user in music creation and improve the efficiency of music creation. Description of the Drawings

[0049] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following will briefly introduce the drawings required for use in the embodiments or related technology descriptions. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1A It is an explanatory schematic diagram of the music score for the present application;

[0051] Figure 1B It is an application scenario schematic diagram of an embodiment of the present application;

[0052] Figure 2A It is a flowchart of the music texture generation method of an embodiment of the present application;

[0053] Figure 2B It is an input-output process example diagram of the music texture generation of an embodiment of the present application;

[0054] Figure 2C Schematic diagram of the mutual influence relationship among three probability distributions according to an embodiment of the present application;

[0055] Figure 2D Example diagram of C major triad on a piano keyboard according to an embodiment of the present application;

[0056] Figure 3 Block diagram of a music texture generation device according to an embodiment of the present application;

[0057] Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. Detailed implementation manners

[0058] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and then implement the present application, rather than limiting the scope of the present application in any way. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to be able to fully convey the scope of the present application to those skilled in the art.

[0059] In this article, it should be understood that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.

[0060] For the convenience of understanding, the nouns involved in the embodiments of the present application are explained below:

[0061] Texture: It is one of the structural forms of music. In a musical work, the pattern of accompaniment notes is like the texture on clothes, which can be woven with different patterns and all have a repetitive beauty, so it is called texture.

[0062] A Markov chain is a random process in probability theory and mathematical statistics that has the Markov property and exists in a discrete index set and state space.

[0063] MIDI, Musical Instrument Digital Interface, is a musical standard format that was proposed in the early 1980s to solve the communication problem between electro-acoustic musical instruments. MIDI is the most widely used musical standard format in the field of music arrangement and can be called "sheet music that a computer can understand". It records music with digital control signals of notes.

[0064] Based on the above description of the background technology, the following situations also exist in the related art:

[0065] The creative process for contemporary pop music encompasses melody creation, lyric writing, arranging and producing instrumental accompaniment, mixing, and mastering. Automatic composition involves using computer algorithms to program music to automatically create scores. Within this process, automatic composition has the potential to primarily address melody creation and arrangement.

[0066] The main basis for the coordinated development of the arrangement and melody is the change of chords, e.g. Figure 1A The musical score shown. A chord, literally meaning three or more notes stacked vertically, possesses unique and distinctive qualities that make it the thread through which most musical compositions flow. In music, chords often don't appear directly as a series of notes stacked vertically, but rather as a "texture" played by accompanying instruments, forming the accompaniment to a song.

[0067] Generally speaking, musical textures are often generated through step sequencers, arpeggiators, or neural network models. These methods have the following advantages and disadvantages:

[0068] Step sequencer: Many music production software programs integrate a flexible step sequencer. Users simply select a texture template (which can also be edited) and a chord to generate a repeating MIDI clip. This solution is more user-friendly for users with a basic understanding of music production, as it can generate the desired texture in a short time. Pre-made templates are generally well-proven in music creation practice. However, the number of templates is ultimately limited, and fully automated texture generation can easily result in completely repetitive clips.

[0069] Arpeggiators are commonly found in various music production software and even electronic keyboard programs. Users simply select chords and some basic arpeggio characteristics (such as the pitch range) to produce harmonious arpeggios. This solution consumes minimal computing and storage resources, but its biggest problem is that the texture pattern is relatively monotonous, leaving little room for creative expression.

[0070] Neural Network Models: In recent years, many deep learning researchers have attempted to learn patterns in texture creation from existing texture data. However, deep neural networks rarely perform reliably in texture creation. Typical neural networks generate textures by classifying each point in a two-dimensional matrix composed of a time grid and pitch as either "played" or "not played." This leads to a vast array of possible outcomes, and compared to other approaches, neural networks are most likely to produce musically incorrect and unpleasant results without human intervention.

[0071] Based on the above description, the principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application.

[0072] The present application provides a method and apparatus for generating a musical texture, an electronic device, and a storage medium. It can use a Markov chain to perform probability sampling on the notes contained in a musical score, generating a corresponding numbered sequence. In this way, the user can dynamically adjust the numbered sequence generated by the Markov chain according to common music theory rules and habits, and then generate music, which can assist the user in music creation and improve the efficiency of music creation.

[0073] Reference Figure 1B , which is a schematic diagram of the application scenario of the method for generating a musical texture provided by an embodiment of the present application. This application scenario includes a terminal device 101, a server 102, and a data storage system 103. Among them, the terminal device 101, the server 102, and the data storage system 103 can all be connected through a wired or wireless communication network. The terminal device 101 includes, but is not limited to, a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA), or other electronic devices that can implement the above functions. The server 102 and the data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0074] The server 102 can receive the musical score sent by the user through the terminal device 101, then use a Markov chain to perform note probability sampling processing on the musical score, and then generate a numbered sequence. The generated numbered sequence is sent to the terminal device 101 for the user to view the numbered sequence through the terminal device. Then, the user adjusts the numbered sequence according to the actual needs of music creation, and inputs the adjustment data through the terminal device 101. The terminal device 101 sends the adjustment data to the server 102. The server 102 makes corresponding adjustments to the numbered sequence according to the adjustment data, generates the musical texture required by the user according to the adjusted numbered sequence, and then sends the musical texture to the terminal device 101 for the user to view. The data storage system 103 provides data storage support for the operation of the server 102, such as storing the program code corresponding to the method for generating a musical texture.

[0075] In addition, the music texture generation method of the present application can also be directly applied to a terminal device, and a client capable of implementing the music texture generation method is installed on the terminal device. The user inputs a music score through the client, and the client uses the Markov chain to perform note probability sampling processing on the music score, and then generates a number sequence. The generated number sequence is sent to the display screen of the terminal device for the user to view the number sequence. Then, the user inputs adjustment data through the client according to the actual music creation needs, and the client adjusts the number sequence accordingly according to the adjustment data, and generates the music texture required by the user according to the adjusted number sequence.

[0076] The following Figure 1B application scenarios are used to describe the music texture generation method according to the exemplary embodiments of the present application. It should be noted that the above application scenarios are only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in this regard. On the contrary, the embodiments of the present application can be applied to any applicable scenario.

[0077] An embodiment of the present application provides a music texture generation method, as Figure 2A shown, including:

[0078] Step 201, receiving a music score.

[0079] In specific implementation, the music score may be a score of chords, and the score of chords may include multiple chords. For example, Figure 2B as shown, the input chord score includes: chord 1, chord 2, chord 3, and chord 4. After being processed in subsequent steps, four music textures can be generated, namely: note sequence 1, note sequence 2, note sequence 3, and note sequence 4.

[0080] Step 202, using the Markov chain algorithm to perform sampling processing on the music score, and generating a number sequence corresponding to the music score according to the sampling result.

[0081] In specific implementation, through the Markov chain algorithm, the notes in the music score can be sampled according to the law of the data required by the Markov chain, and the data required by the Markov chain is collected as the sampling result. Then, the sampling result is generated into a number sequence according to the corresponding arrangement method of the Markov chain.

[0082] Among them, the number sequence includes two dimensions, namely the time point and the note number corresponding to the voice part. At the same time point, if there are several notes, there will be several voice parts corresponding to that time point.

[0083] In some embodiments, before step 202, the method includes:

[0084] Step 20A: Receive the set parameter values of the Markov chain and determine the Markov chain algorithm according to the parameter values.

[0085] In specific implementation, Step 20A can be set before Step 201, or can be set after Step 201 and before Step 202, and the specific selection is made according to actual requirements.

[0086] Among them, the acquisition of the set parameter values of the Markov chain can be the values of each parameter directly input by the user, or various modes can be pre-stored, and each mode corresponds to a set of parameter values. The user can select one from various modes, and thus the parameter values of the selected mode stored can be used as the parameter values of the Markov chain. In this way, these parameter values can be supplemented into the Markov chain algorithm.

[0087] In some embodiments, the parameter values of the Markov chain include at least one of the following:

[0088] The number of notes N, the note density D, the note expansion range of the note numbers, and the maximum number of notes at the same moment.

[0089] In specific implementation, the explanations of the above-mentioned parameter values are as follows:

[0090] The number of notes N: While defining the number of notes N, the length of the minimum note (such as a sixteenth note or an eighth note) is also specified. The number of notes N defines the maximum number of equal-length notes that can appear in a measure (or a mode), and also constitutes the basic grid in the time dimension.

[0091] The note density D: Determines what proportion of the time points in the grid will have notes at each time point.

[0092] The note expansion range: The number of notes that can be expanded upward (for example, 1 to L). This note expansion range is preferably the chord expansion range (1 - L), which determines how many notes in the chord and its upward expansion are used.

[0093] The maximum number of notes: Determines the maximum number of notes that may appear at the same moment.

[0094] In specific implementation, before setting the above-mentioned parameter values, the setting ranges of the parameter values have been pre-stored, so as to ensure that the setting of each parameter value can be within the normal range. If the set parameter value exceeds the corresponding setting range, the user will be prompted "Out of range, reset".

[0095] Through the above solution, the user can set parameter values according to their own needs for music composition, which can meet the diverse needs of the user.

[0096] In some embodiments, step 202 includes:

[0097] Step 2021, sampling the note distribution data in the music score based on the parameter values in the Markov chain algorithm to determine the first probability distribution of note time points, the second probability distribution of note numbers, and the third probability distribution of multiple voices corresponding to the note time points, where each voice in the multiple voices corresponds to a note.

[0098] Specifically, the three probability distributions obtained by sampling the music score: the first probability distribution, the second probability distribution, and the third probability distribution are components of the Markov chain.

[0099] Among them, as Figure 2C shown, the distribution of the first probability distribution will affect the second probability distribution and the third probability distribution. Therefore, the first probability distribution is sampled first, and the second probability distribution and the third probability distribution are sampled based on the sampling results of the first probability distribution after the first probability distribution sampling is completed. And as Figure 2C shown, the three probability distributions are also affected by themselves.

[0100] In some embodiments, the determination process of the first probability distribution includes:

[0101] Step 2021a1, determining an initial first probability distribution, where the corresponding values of each time point in the initial first probability distribution form a uniform distribution.

[0102] Specifically, using a uniform distribution as the initial first probability distribution is to ensure the unity of each time point before sampling the music score.

[0103] Step 2021a2, sampling the initial first probability distribution N×D times according to the note time distribution in the music score to obtain the first probability distribution.

[0104] Specifically, the music score is a chord score, and the chord score can be divided into one or more beats. The notes within each beat and the duration or interval of the notes constitute the note time distribution. The number of notes and the note density are set in the above steps, so N×D is the total number of notes in the music score. Therefore, probability sampling needs to be performed on each note, and thus N×D samplings are required. After sampling, the first probability distribution is obtained.

[0105] In some embodiments, step 2021a2 includes:

[0106] After each sampling, the probability distribution of the remaining time points in the initial first probability distribution changes accordingly according to a preset rule, where the preset rule is a preset pitch change rule; after determining that all N×D samplings are completed, the final initial first probability distribution is used as the first probability distribution.

[0107] In specific implementation, after sampling the time point corresponding to the first note, in the initial first probability distribution, the probability of the notes at the time points after the first note will also change accordingly, and the specific value of the corresponding change amount (increasing or decreasing the probability of other notes appearing) can be specifically adjusted according to the preset pitch change rule. For example, the preset pitch change rules can be divided into pop pitch, jazz pitch, classical pitch, DJ pitch, etc., and can be specifically preset according to the music scene. After the probabilities of all note time points are collected, they can be used as the first probability distribution. Furthermore, the distribution probability of the notes at each time point can be accurately determined.

[0108] In some embodiments, the process of determining the second probability distribution includes:

[0109] Step 2021b1, obtain each corresponding time point in the first probability distribution.

[0110] Step 2021b2, determine the probability of the note number corresponding to each time point according to the music score, where the note number corresponding to each time point is within the note expansion range.

[0111] Step 2021b3, integrate the probability distributions of all time points to obtain the second probability distribution.

[0112] In specific implementation, corresponding numbering processing will be performed on the notes required by the music score (for example, chord score). For example, Figure 2D The example diagram of the C major chord on the piano keyboard shows that its respective notes and their upward expansion in the octave are numbered in sequence as 1, 2, 3, 4, 5, 6... and so on. Similarly, all input chords have such a one-to-one mapping relationship between numbers and notes. The range of the corresponding note numbers is from 1 to L, where L is a positive integer.

[0113] After corresponding numbering of each note, the probability distribution of the note time points in the first probability distribution can be used to sample each time point. Sample the probability distribution of the note numbers (from 1 to L) at each time point according to the music score. Similarly, after each sampling, the probability distribution of the note numbers at the remaining time points will also change and be adjusted according to a certain pitch change rule.

[0114] In some embodiments, the process of determining the third probability distribution includes:

[0115] Step 2021c1: Obtain each corresponding time point in the first probability distribution, and determine the time point T with notes from these time points.

[0116] In specific implementation, after determining the notes (present or rest) at each time point according to the first probability distribution, the first row of the matrix required for the corresponding third probability distribution is constructed.

[0117] Step 2021c2: Determine the probability P of notes in multiple voices at each time point T according to the music score, and integrate all the obtained note probabilities P to obtain the third probability distribution.

[0118] In specific implementation, there may be polyphony, i.e., "harmony", in each time point with notes. According to the music score, determine the probability of independent note numbers for each voice in the time point with multiple voices. The probabilities of the note numbers corresponding to each voice in this time point are used as the note probabilities P of multiple voices. Integrate the note probabilities P of multiple voices in each time point to obtain the third probability distribution.

[0119] In some embodiments, determining the probability P of notes in multiple voices at each time point T in step 2021c2 according to the music score includes:

[0120] In response to determining that there are multiple voices at time point T' according to the music score, sample the note probability P of the notes corresponding to each voice at time point T' according to the music score, and set the sampled note probability of the voice-corresponding note to zero.

[0121] In specific implementation, when there are multiple voices at a certain time point T', the note probability P of the notes corresponding to each voice is independent, that is, it is ensured that the probabilities corresponding to the multiple voices at this time point are also sampled sequentially. For example, after sampling the first voice in the multiple voices, set the note probability of the selected note of the first voice to zero before sampling the second voice, to ensure that the notes generated by the first voice will not be generated by the subsequent voices.

[0122] Through the above solution, the third probability distribution composed of the probabilities of multiple voices existing at each time point is obtained, and the corresponding "harmony" can be generated according to the third probability distribution.

[0123] Step 2022: Superimpose the first probability distribution, the second probability distribution, and the third probability distribution to generate the number sequence corresponding to the music score.

[0124] In specific implementation, all three probability distributions are in the form of matrix data, and the number of time dimensions corresponding to the three probability distribution matrices is the same. Therefore, the three probability distribution matrices can be directly superimposed to generate the corresponding number sequence.

[0125] Step 203: Receive the input adjustment data, and adjust the number sequence according to the adjustment data to obtain an adjusted number sequence.

[0126] In specific implementation, the user can make corresponding adjustments to the generated number sequence for music creation. During the adjustment process, if any time point in the first probability distribution is adjusted, the probability distributions of subsequent time points will also be adjusted accordingly, and the second and third probability distributions will change accordingly with the change of the first probability distribution. If the second or third probability distribution is adjusted, the remaining parts of the second or third probability distribution will also be dynamically adjusted accordingly.

[0127] In some embodiments, step 203 includes:

[0128] Step 2031: In response to determining that the received adjustment data belongs to the set parameter data, adjust the number sequence according to the parameter data to obtain an adjusted number sequence.

[0129] Step 2032: In response to determining that the adjustment data belongs to the music style, retrieve the parameter data corresponding to the music style from the storage database, and adjust the number sequence according to the parameter data to obtain an adjusted number sequence.

[0130] In specific implementation, the corresponding adjustment data can be to increase or decrease the notes, or adjust the interval time between time points, etc. The required parameter data for adjustment can be input by the user, or the target music style selected by the user from several music styles, and the parameter data stored corresponding to the target music style is retrieved from the database.

[0131] For example, if the interval between adjacent notes in the obtained number sequence is too large and does not conform to the reality of performance, after sampling a note number Y, the probabilities of Y - 1 and Y + 1 appearing at the next time point can be increased, while the probabilities of note Y itself and notes such as Y + 3 and Y - 3 that are relatively far apart appearing at the next time point can be decreased. When it is necessary to simulate a texture with more repeated notes (but different from simple chord repetitions), the probability of Y itself appearing again can be appropriately increased based on the number sequence while decreasing the probabilities of other note numbers appearing.

[0132] Through the above solution, after the adjustment is completed, the adjusted number sequence can be obtained. This method can meet the diverse needs of users. And due to the Markov property of the Markov chain, after the user adjusts one data during the adjustment process, corresponding dynamic adjustments will be made without manually setting each probability distribution, enhancing the rhythm of the created music, so that the tendency of the generated music texture in terms of features can be flexibly controlled.

[0133] Step 204: Generate a music texture according to the adjusted number sequence.

[0134] In specific implementation, map the adjusted number sequence to each specific note, so that the corresponding note sequence can be obtained, and use this note sequence as the MIDI file of the music texture.

[0135] In some embodiments, Step 204 includes:

[0136] Step 2041: Generate corresponding note velocity data according to the adjusted number sequence using a uniform distribution function or a sine variation function.

[0137] Among them, the note velocity data is a series of continuous note velocity values. Uniform distribution means that each note velocity data is a similar value, such as 60. Sine variation means the value that changes according to the sine function of the note velocity data, and the sine variation is performed with the music measure as the period.

[0138] Step 2042: Determine the music texture according to all the note velocity data corresponding to the adjusted number sequence.

[0139] In specific implementation, the generated music texture is the obtained MIDI file, and the MIDI file is output, thus completing the music creation of the chord.

[0140] In some embodiments, Step 2042 includes:

[0141] Increase the note velocity data of the first beat in all the note velocity data by a predetermined velocity value; add or subtract a random number within a predetermined velocity range to each note velocity data to obtain the music texture.

[0142] In specific implementation, based on the uniform distribution function and the sine function, emphasize the note of the first beat in each measure (that is, increase the note velocity of the note by a predetermined velocity value), and add or subtract a small random number from the note velocity data of each note to make it closer to the velocity of human performance. The random number is within a small predetermined velocity range, for example, the predetermined velocity range is [0, 0.1]. Then the random number is any value within this range.

[0143] Through the solutions of the above embodiments, the common music theory rules and habits of human composers for writing textures are fully utilized. By building the program corresponding to the music texture generation method in the collaborative MIDI generation system combined with the melody generation model, the usability of this embodiment in the full-automatic music generation scenario can be verified. Through the practice of using this music texture generation method to assist music creation, it is proved that using this method can effectively shorten the time of the arrangement step in music creation, helping the creator to focus more energy on other parts that are more easily perceived by the audience, such as melody creation. The solutions of this embodiment have high application value whether for the situation of mass-producing music or for the situation of carefully producing music.

[0144] It should be noted that the method of the embodiment of the present application can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this case of a distributed scenario, one of the multiple devices can only execute one or more steps of the method of the embodiment of the present application, and these multiple devices will interact with each other to complete the described method.

[0145] It should be noted that some embodiments of the present application are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order from that in the above embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0146] Based on the same inventive concept, corresponding to the music texture generation method of any of the above embodiments, the present application also provides a music texture generation device.

[0147] Refer to Figure 3 , the device includes:

[0148] A receiving module 31, configured to receive a music score;

[0149] A Markov chain processing module 32, configured to sample the music score using the Markov chain algorithm and generate a number sequence corresponding to the music score according to the sampling result;

[0150] An adjustment module 33, configured to receive input adjustment data and adjust the number sequence according to the adjustment data to obtain an adjusted number sequence;

[0151] A texture generation module 34, configured to generate a music texture according to the adjusted number sequence.

[0152] In some embodiments, the apparatus further comprises:

[0153] A parameter setting module, configured to receive the parameter values of the set Markov chain and determine the Markov chain algorithm according to the parameter values.

[0154] In some embodiments, the parameter values of the Markov chain include at least one of the following:

[0155] The number of notes N, the note density D, the note expansion range of the note numbers, and the maximum number of notes at the same moment.

[0156] In some embodiments, the Markov chain processing module 32 includes:

[0157] A sampling unit, configured to sample the note distribution data in the music score based on the parameter values in the Markov chain algorithm, and determine the first probability distribution of the note time points, the second probability distribution of the note numbers, and the third probability distribution of the polyphony corresponding to the note time points, wherein each voice in the polyphony corresponds to a note;

[0158] An overlay unit, configured to overlay the first probability distribution, the second probability distribution, and the third probability distribution to generate the number sequence corresponding to the music score.

[0159] In some embodiments, the sampling unit is further configured to:

[0160] Determine an initial first probability distribution, wherein the corresponding values of each time point in the initial first probability distribution form a uniform distribution; according to the note time distribution in the music score, sample the initial first probability distribution N×D times to obtain the first probability distribution.

[0161] In some embodiments, the sampling unit is further configured to:

[0162] After each sampling, the probability distribution of the remaining time points in the initial first probability distribution changes accordingly according to a preset rule, wherein the preset rule is a preset pitch change rule;

[0163] After determining that all N×D samplings are completed, use the final initial first probability distribution as the first probability distribution.

[0164] In some embodiments, the sampling unit is further configured to:

[0165] Obtain each corresponding time point in the first probability distribution; determine the probability of the note number corresponding to each time point according to the music score, where the note number corresponding to each time point is within the range of the note extension; integrate the probability distributions of all time points to obtain the second probability distribution.

[0166] In some embodiments, the sampling unit is further configured to:

[0167] Obtain each corresponding time point in the first probability distribution, and determine the time point T with notes existing from each time point; determine the probability P of multi-voice notes existing in each time point T according to the music score, and integrate all obtained note probabilities P to obtain the third probability distribution.

[0168] In some embodiments, the sampling unit is further configured to:

[0169] In response to determining that there are multi-voices at the time point T' according to the music score, sample the note probability P of the notes corresponding to each voice at the time point T' according to the music score, and set the sampled note probability of the voice corresponding notes to zero.

[0170] In some embodiments, the adjustment module 33 is further configured to:

[0171] In response to determining that the adjustment data belongs to the set parameter data, adjust the number sequence according to the parameter data to obtain an adjusted number sequence; in response to determining that the adjustment data belongs to the music style, retrieve the parameter data corresponding to the music style from the storage database, and adjust the number sequence according to the parameter data to obtain an adjusted number sequence.

[0172] In some embodiments, the texture generation module 34 includes:

[0173] A note intensity generation unit, configured to generate corresponding note intensity data according to the adjusted number sequence by a uniform distribution function or a sine variation function;

[0174] A texture generation unit, configured to determine the music texture according to all note intensity data corresponding to the adjusted number sequence.

[0175] In some embodiments, the texture generation unit is further configured to:

[0176] Increase the note intensity data of the first beat in all note intensity data by a predetermined intensity value; add or subtract a random number within a predetermined intensity range to each note intensity data to obtain the music texture.

[0177] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in any of the above embodiments is implemented.

[0178] Figure 4 FIG. shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 410, a memory 420, an input / output interface 430, a communication interface 440, and a bus 450. Among them, the processor 410, the memory 420, the input / output interface 430, and the communication interface 440 are communicatively connected to each other inside the device through the bus 450.

[0179] The processor 410 may be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0180] The memory 420 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 420 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 420 and are called and executed by the processor 410.

[0181] The input / output interface 430 is used to connect to an input / output module to implement information input and output. The input / output module may be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0182] The communication interface 440 is used to connect to a communication module (not shown in the figure) to implement communication interaction between this device and other devices. Among them, the communication module may implement communication in a wired manner (such as USB, network cable, etc.) or in a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).

[0183] The bus 450 includes a path for transmitting information between various components of the device, such as the processor 410, the memory 420, the input / output interface 430, and the communication interface 440.

[0184] It should be noted that although the above device only shows the processor 410, the memory 420, the input / output interface 430, the communication interface 440, and the bus 450, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0185] The electronic device of the above embodiment is used to implement the corresponding music texture generation method in any of the foregoing embodiments, and has the beneficial effects of the corresponding music texture generation method embodiment, which will not be repeated here.

[0186] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the method described in any of the foregoing embodiments.

[0187] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0188] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the method described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0189] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; within the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.

[0190] In addition, for simplicity of explanation and discussion, and in order not to make the embodiments of the present application difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application are to be implemented (i.e., these details should be entirely within the understanding of those skilled in the art). In cases where specific details (such as circuits) are set forth to describe exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application may be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0191] Although the present application has been described in connection with specific embodiments of the present application, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0192] The embodiments of the present application are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included within the protection scope of the present application.

Claims

1. A method for generating a music texture, characterized in that Including: Receiving a musical score; Sampling the musical score by using a Markov chain algorithm, collecting data required for the Markov chain as a sampling result, and generating a number sequence corresponding to the musical score according to the arrangement mode corresponding to the Markov chain; wherein, the number sequence includes time points and note numbers corresponding to voice parts; Receiving input adjustment data, and adjusting the number sequence according to the adjustment data to obtain an adjusted number sequence; Generating a musical texture according to the adjusted number sequence.

2. The method according to claim 1, characterized in that, Before sampling the musical score by using the Markov chain algorithm, it includes: Receiving set parameter values of the Markov chain, and determining the Markov chain algorithm according to the parameter values.

3. The method according to claim 2, wherein The parameter values of the Markov chain include at least one of the following: The number of notes N, the note density D, the note expansion range of note numbers, and the maximum number of notes at the same moment.

4. The method according to claim 3, wherein The sampling the musical score by using the Markov chain algorithm and generating a number sequence corresponding to the musical score according to the sampling result includes: Sampling the note distribution data in the musical score based on the parameter values in the Markov chain algorithm to determine a first probability distribution of note time points, a second probability distribution of note numbers, and a third probability distribution of multiple voice parts corresponding to note time points, wherein each voice part in the multiple voice parts corresponds to a note; Superimposing the first probability distribution, the second probability distribution, and the third probability distribution to generate a number sequence corresponding to the musical score.

5. The method according to claim 4, characterized in that, The determination process of the first probability distribution includes: Determining an initial first probability distribution, wherein the corresponding values of each time point in the initial first probability distribution form a uniform distribution; Sampling the initial first probability distribution N×D times according to the note time distribution in the musical score to obtain the first probability distribution.

6. The method according to claim 5, wherein The sampling the initial first probability distribution N×D times to obtain the first probability distribution includes: After each sampling, the probability distribution of the remaining time points in the initial first probability distribution changes accordingly according to a preset rule, wherein the preset rule is a preset pitch change rule; After determining that N×D samplings are all completed, taking the final initial first probability distribution as the first probability distribution.

7. The method according to claim 5, wherein The determination process of the second probability distribution includes: Obtaining each corresponding time point in the first probability distribution; Determining the probability of the note number corresponding to each time point according to the musical score, wherein the note number corresponding to each time point is within the note expansion range; Integrating the probability distributions of all time points to obtain the second probability distribution.

8. The method according to claim 5, characterized in that, The determination process of the third probability distribution includes: Obtaining each corresponding time point in the first probability distribution, and determining the time points T with notes existing from each time point; Determining the note probability P of multiple voice parts existing in each time point T according to the musical score, and integrating all obtained note probabilities P to obtain the third probability distribution.

9. The method according to claim 8, wherein The determining the note probability P of multiple voice parts existing in each time point T according to the musical score includes: In response to determining that there are multiple voices at time point T' according to the music score, sample the note probability P of the notes corresponding to each voice at time point T' according to the music score, and set the sampled note probability of the notes corresponding to the voice to zero.

10. The method according to claim 1, wherein The adjusting the number sequence according to the adjustment data to obtain an adjusted number sequence includes: In response to determining that the adjustment data belongs to set parameter data, adjusting the number sequence according to the parameter data to obtain an adjusted number sequence; In response to determining that the adjustment data belongs to a music style, retrieving parameter data corresponding to the music style from a storage database, and adjusting the number sequence according to the parameter data to obtain an adjusted number sequence.

11. The method according to claim 1, wherein The generating a music texture according to the adjusted number sequence includes: Generating corresponding note intensity data from the adjusted number sequence according to a uniform distribution function or a sine variation function; Determining the music texture according to all the note intensity data corresponding to the adjusted number sequence.

12. The method according to claim 11, wherein The determining the music texture according to all the note intensity data corresponding to the adjusted number sequence includes: Increasing the note intensity data of the first beat among all the note intensity data by a predetermined intensity value; Adding or subtracting a random number within a predetermined intensity range to each note intensity data to obtain the music texture.

13. A music texture generation device, characterized in that, including: a receiving module configured to receive a music score; a Markov chain processing module configured to perform sampling processing on the music score by using a Markov chain algorithm, collect data required for the Markov chain as a sampling result, and generate a number sequence corresponding to the music score in an arrangement manner corresponding to the Markov chain; wherein the number sequence includes time points and note numbers corresponding to voices; an adjustment module configured to receive input adjustment data and adjust the number sequence according to the adjustment data to obtain an adjusted number sequence; a texture generation module configured to generate a music texture according to the adjusted number sequence.

14. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the method described in any one of claims 1 to 12 is implemented.

15. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause a computer to execute the method described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • System and methods for automatically generating a muscial composition having audibly correct form

    GB202104696D0

  • Method of training a neural network to reflect emotional perception, related system and method for categorizing and finding associated content and related digital media file embedded with a multi-dimensional property vector

    TW202101431A