WO2021115311A1 - Song generation method, apparatus, electronic device, and storage medium - Google Patents

Song generation method, apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2021115311A1
WO2021115311A1 PCT/CN2020/134835 CN2020134835W WO2021115311A1 WO 2021115311 A1 WO2021115311 A1 WO 2021115311A1 CN 2020134835 W CN2020134835 W CN 2020134835W WO 2021115311 A1 WO2021115311 A1 WO 2021115311A1
Authority
WO
WIPO (PCT)
Prior art keywords
music
attribute information
confirmation instruction
fragments
candidate
Prior art date
Application number
PCT/CN2020/134835
Other languages
French (fr)
Chinese (zh)
Inventor
蒋慧军
黄尹星
姜凯英
韩宝强
肖京
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021115311A1 publication Critical patent/WO2021115311A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/61Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/63Querying
    • G06F16/635Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/65Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/68Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/683Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content

Definitions

  • This application relates to the field of data processing technology, and in particular to a method, device, electronic device, and storage medium for generating music.
  • the present application provides a music generation method, electronic equipment, and storage medium, the main purpose of which is to live in a controlled manner to meet the needs of users with new music.
  • the embodiment of the present application first provides a method for generating music, including the following steps: receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of the music according to the first confirmation instruction; the first confirmation instruction is correct The first music attribute information and the selection confirmation instruction of the emotion tag; determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag; combine the first music attribute information with The second music attribute information is used as a filter condition to traverse the pre-built music database to obtain candidate music pieces matching the filter condition; wherein the music database stores a plurality of music pieces pre-divided according to the music attributes; The received second confirmation instruction selects a music fragment from the candidate music fragments, and splices the music fragments in the order of the corresponding music bars to obtain a new music piece; wherein, the second confirmation instruction is to select a music fragment Confirm the instruction.
  • an embodiment of the present application also provides a music generating device, including: a first music attribute information obtaining module, configured to receive a first confirmation instruction, and obtain first music attribute information of the music according to the first confirmation instruction and Emotion tag; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and the emotion tag; the second music attribute information module is determined to be used based on the pre-set association relationship between the emotion tag and the music attribute and the The emotion tag determines the second music attribute information of the music; the obtaining candidate music segment module is used to traverse the pre-built music database using the first music attribute information and the second music attribute information as filtering conditions, and obtain the information corresponding to the filtering conditions.
  • a matching candidate music piece wherein the music database stores a plurality of music pieces pre-divided according to music attributes; a new music piece module is used to select from the candidate music pieces according to the received second confirmation instruction Music fragments, the music fragments are spliced in the order of corresponding music bars to obtain a new music piece; wherein, the second confirmation instruction is a selection confirmation instruction for the music fragment.
  • an embodiment of the present application also provides an electronic device, the electronic device includes: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the program
  • the following method is implemented: receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of a music piece according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags; Determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag; use the first music attribute information and the second music attribute information as filter conditions to traverse the pre-built music A database to obtain candidate music pieces matching the screening conditions; wherein the music database stores a plurality of music pieces pre-divided according to music attributes; according to the received second confirmation instruction, from the candidate music pieces The music fragments are selected, and the music fragments are spliced in the order of the corresponding music bars to obtain a new music piece; wherein the second confirmation instruction is a selection confirmation
  • the present application also provides a computer-readable storage medium
  • the computer-readable storage medium includes a music generation program, and when the music generation program is executed by a processor, the following method is implemented: Confirmation instruction, according to the first confirmation instruction to obtain the first music attribute information and emotion tag of the music; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tag; based on the preset emotion tag and The association relationship between the music attributes and the emotion tag determine the second music attribute information of the music; the first music attribute information and the second music attribute information are used as filtering conditions to traverse the pre-built music database to obtain the information related to the filtering Candidate music fragments matching the conditions; wherein the music database stores a plurality of music fragments pre-divided according to music attributes; according to the received second confirmation instruction, a music fragment is selected from the candidate music fragments, and the The music fragments are spliced in the order of the corresponding music bars to obtain a new music piece; wherein, the second
  • the first confirmation instruction provided in this application is based on the user's selection of music attributes
  • the second confirmation instruction is based on the user's selection of candidate music fragments.
  • the first confirmation instruction and the second confirmation instruction are used to determine the music fragment, that is, the process of generating new music.
  • the determination of the music attributes and music fragments is based on user selection, so the generated music is highly related to the user’s preferences, and the human-computer interaction in the music generation process is strong.
  • the generated music is generated by this application.
  • the music is controllable and reproducible, that is, it can reproduce the process of music generation.
  • the music generation method provided in this application preliminarily stores music sections according to music attribute information for a large number of music data samples to obtain a music database.
  • the music attributes selected by the user are used to filter matching music.
  • Fragments, music fragments include multiple music bars. Since the new music is formed based on existing music fragments, the melody of the new music conforms to the harmony trend, and the generated music is coherent.
  • FIG. 1 is a flowchart of a method for generating a music composition according to an embodiment of the application.
  • FIG. 2 is a flowchart of determining second music attribute information of a music piece based on the association relationship between preset emotion tags and music attributes and the emotion tags according to an embodiment of the application.
  • FIG. 3 is a schematic diagram of a valence-Arousal dimensional emotion model provided by an embodiment of this application.
  • FIG. 4 is a schematic diagram of a melody curve provided by an embodiment of the application with a small-amplitude gyration, and the middle tone in the melody curve is adjusted in the opposite direction to the tuning inner tone.
  • FIG. 5 is a schematic structural diagram of a music generating device provided by an embodiment of the application.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
  • the technical solution of this application can be applied to the fields of artificial intelligence, smart city, blockchain and/or big data technology.
  • the data involved in this application such as attribute information, tags, and/or music, can be stored in a database, or can be stored in a blockchain, such as distributed storage through a blockchain, which is not limited in this application.
  • Figure 1 is a flowchart of the method for generating music provided by an embodiment of the application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the method can be executed on the user side, and the user side includes a human-computer interaction interface.
  • S110 Receive a first confirmation instruction, and obtain first music attribute information and emotion tags of the music according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags.
  • S120 Determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag.
  • S140 Select a music fragment from the candidate music fragments according to the received second confirmation instruction, and splice the music fragments in the order of the corresponding music bars to obtain a new music piece; wherein the second confirmation instruction is right Confirm the selection of music fragments.
  • the music attributes provided in this application include at least the following information: rhythm type, speed, chord, key, mode, time signature, musical structure, texture, orchestration, etc.
  • the music attribute information is divided into The first music attribute information and the second music attribute information.
  • the first music attribute information includes: music type, structure, music length, key, time signature
  • the second music attribute information includes: mode, harmony direction, speed, and Rhythm information.
  • the overall structure of the music can be determined according to the first music attribute information, and the emotion expressed by the music can be determined according to the second music attribute information.
  • the server or the client receives the first confirmation instruction, the first confirmation instruction is the user's selection confirmation instruction of the first music attribute information and emotion tag, the first confirmation instruction may be input through the human-computer interaction interface and sent through the client
  • the selection confirmation instruction for the first music attribute information and emotion tag of the generated music, the first confirmation instruction can be regarded as the user's selection of the first music attribute information and emotion tag, that is, both the first music attribute information and emotion tag can be Selected for users according to their own preferences.
  • the pre-built association relationship between the emotion tag and the music attribute is called, and the second music attribute information of the music piece is determined according to the determined emotion tag and the association relationship.
  • the association relationship between emotion tags and music attributes can be reflected by matching emotions with rhythmic information or/and speed.
  • the granularity of each music section will affect The emotional expression of the melody curve.
  • the same note granularity may have different emotional expressions at different speeds. Therefore, this solution associates the second music attribute information with the emotional tags when constructing the music database, for example, the speed is relatively high. Fast music often expresses cheerful emotions, while slow music often expresses melancholy and sad emotions.
  • the first music attribute information and the second music attribute information are used as filter conditions to traverse the pre-built music database to obtain candidate music pieces matching the filter conditions in the music database.
  • the music database stores a plurality of pre-divided music attributes. Music fragments.
  • a music database Prior to this, first construct a music database, the process is as follows: obtain a large number of music data samples, these music data samples can be selected according to the user's preferences, so that the final generated music is more in line with the user's preferences, the music data samples are divided into music subsections It is a plurality of music fragments, each music fragment includes a plurality of continuous music bars, and each music bar has the position and number of the music in which it is located. The music fragments are classified and stored according to the above-mentioned music attributes, and a music database is constructed.
  • the music database is also called a data set dictionary. That is, the music database is a dictionary storing music attribute information and music attribute parameters, and the dictionary can be stored in a hierarchical structure of rhythm-chords.
  • the identification information of these music pieces includes first music attribute information and second music attribute information
  • the first music attribute information and the second music attribute information selected by the user are used.
  • the music database is traversed as a filter condition, and music pieces that meet the filter condition are selected, that is, music pieces that match the first music attribute information and the second music attribute information selected by the user are filtered out, and the multiple music pieces selected are candidate music pieces.
  • a plurality of music fragments are determined according to the second confirmation instruction, and the music fragments are spliced in the order of the music bars included in the music fragment to obtain a new music piece.
  • the first confirmation instruction and the second confirmation instruction are used as filter conditions to determine the music fragments of the new music, because the first confirmation instruction and the second confirmation instruction are the user’s response to the first music attribute information and the emotion tag, respectively.
  • the selection confirmation instructions of candidate music fragments can all reflect the user's preferences, therefore, the final new music composition conforms to the user's preferences.
  • the music fragments that make up the new music are extracted from the music database, and the music fragments stored in the music database are all existing music data. Therefore, the new music generated has continuity; further, it is not compatible with the use of deep learning. Compared with the box-like generation method, the path of generating new music in this scheme can be traced back, and the new music generated is controllable and reproducible.
  • step S120 the step of determining the second music attribute information of the music based on the pre-set association relationship between the emotion tag and the music attribute and the emotion tag may be implemented as shown in FIG. 2 , Including the following sub-steps.
  • S220 Determine candidate second music attribute information of the music piece according to the quantized emotion tag.
  • S230 Receive and analyze a third confirmation instruction, and confirm the second music attribute information of the music piece from the candidate second music attribute information according to the analysis information of the third confirmation instruction, wherein the third confirmation instruction is for the first 2.
  • the selection confirmation command of the music attribute is for the first 2.
  • the emotion model may be a valence-Arousal dimensional emotion model.
  • a schematic diagram of the valence-Arousal dimensional emotion model is shown in Figure 3
  • the emotion model has two dimensions. One dimension is used to express the positive and negative of emotions, such as happiness, anger, etc., and the other dimension represents the positive degree of emotions. For example, different levels of emotions corresponding to happiness can include: Satisfaction, surprise, etc. indicate the degree of happiness.
  • the positive and negative of the emotion and its positive degree are collectively referred to as the user’s emotional label.
  • the relationship between the emotional label and the second attribute of music is preset.
  • the expression of happy emotion can correspond to the following second Music attribute information: tune up, bright rhythm, etc.
  • the candidate second music attribute information is determined by combining the relationship between the emotion label and the second attribute.
  • the user can select any point in the coordinate axis corresponding to the emotion model, and determine the emotion label corresponding to the coordinate of the point according to the statistical analysis of the data, and then according to the association between the preset emotion label and the second music attribute information
  • the relationship determines candidate second music attribute information, including mode, harmony direction, speed, and rhythm information.
  • the second music attribute corresponding to the dimensional information of the emotion model assuming that the model has four boundary points, and then set the second music attribute to have a linear relationship with the distance from any point in the emotion model to each boundary point, namely The corresponding relationship between the distance from any point to each boundary point in the emotion model and the music attribute is defined in advance. After calculating the distance between any point selected by the user in the model space and each boundary point, the second music attribute information corresponding to the point is obtained according to the corresponding distance.
  • If there are multiple candidate second music attribute information then receive and analyze the third confirmation instruction for the second music attribute information, and determine the music composition from the candidate second music attribute information according to the analysis information of the third confirmation instruction Second music attribute information.
  • the solution provided by this embodiment uses an emotion model to quantify the emotion label, and determines the second music attribute information of the music according to the quantized emotion label, so as to achieve the purpose of determining the second music attribute information of the music according to the emotion label.
  • the second music attribute information is selected from the multiple candidate second music attribute information.
  • the third confirmation instruction is based on the user's selection, the filtered second music attribute information meets the user's preference, and realizes the human-computer interaction in the music generation process, and improves the user experience.
  • the step of traversing a pre-built music database using the first music attribute information and the second music attribute information as filtering conditions in step S130 includes: A1, obtaining orchestration information of the music; A2 , Traverse a pre-built music database according to the first music attribute information, the second music attribute information, and the orchestrator information.
  • the orchestration information includes the allocation of musical instruments to the parts, the first music attribute information, the second music attribute information, and the orchestration information cover more music attribute information of a piece of music, based on the first music attribute information and the second music attribute information.
  • the information and orchestration information traverses the music data dictionary to filter out a number of candidate music pieces that match the filtering conditions.
  • Adding orchestration information to the screening conditions, and traversing the music database by integrating the first music attribute information, the second music attribute information and the orchestration information can reduce the number of candidate music pieces that are collected and filtered from the music database, and help simplify the process of determining music pieces , And the finally obtained music fragments are more in line with user needs.
  • the method further includes: B1, determining the first music attribute information and the second music attribute information according to a preset rule Matching priority of each music attribute; B2, sort the candidate music pieces according to the matching priority of each music attribute; B3, sort the candidate music pieces according to the sorted.
  • the matching priority of each music attribute is divided, and the matching priority of the music attribute can be in order from high to low: musical structure, chord, rhythm pattern, orchestration. If there are currently several candidate music pieces for the user to choose from, you can first sort the candidate music pieces according to the music structure. In the case of the same music structure, sort the music pieces according to the chord. If the music structure and chord are the same In this case, the music clips are sorted according to the rhythm pattern, and so on. These music attributes are sorted according to their influence on the overall structure of the music. According to this method, the candidate music pieces are sorted, which is beneficial for the final generated music to be more in line with user needs.
  • a music fragment is selected from the sorted candidate music fragments according to the received second confirmation instruction, and the music fragments are spliced in the order of the corresponding music bars to obtain a new music piece.
  • a sorted candidate music segment is established for each position of the music, and the step of splicing the music segments in the order of the corresponding music subsections can be implemented in the following manner:
  • the candidate music pieces with the highest ranking corresponding to the positions are spliced according to their position identifiers.
  • each candidate music piece is provided with identification information, and the identification information includes the track to which the music piece belongs (e.g., represented by a track number) and location (e.g., represented by the position number of the music section in the track to which it belongs) ).
  • the identification information includes the track to which the music piece belongs (e.g., represented by a track number) and location (e.g., represented by the position number of the music section in the track to which it belongs) ).
  • the sorted candidate music fragments are created for each position of the music according to the above method, and the steps of splicing the music fragments according to the sequence of the corresponding music sections include:
  • candidate music pieces from the same song are spliced to ensure the fluency of the new music.
  • the method further includes: S150, obtaining the melody curve of the new music, and adjusting the melody curve according to the curve characteristics of the melody curve to obtain Optimize the music.
  • the melody curve is adjusted according to the curve characteristics, so that the melody of the adjusted optimized music composition is more unique.
  • the melody curve here may include note information, pitch information, etc.
  • the characteristics of the curve such as: the melody curve has a position where the melody curve has continuous upward (or downward) more than three units, the melody curve has a small-amplitude convolution, and the adjacent unit The slope of the curve is greater than the preset threshold, the pitch of the notes that exceed three consecutive units is the same, and so on.
  • the step of adjusting the melody curve according to the curve characteristics includes: when it is detected that the melody curve has a small-amplitude gyration, adjusting the middle tone in the melody curve in the opposite direction to the inner tone of the tuning.
  • the melody curve has a small convolution, as shown in Figure 4, if the two consecutive tones are adjacent in the selected key, the middle tone is modified in the opposite direction of the tone, such as: the original upward convolution, then it is modified to the downward convolution , And vice versa, if the selected pitch composition is [do,re,do], modify the pitch composition to [do,si,do], the adjustment process is shown in the solid line box in Figure 4, where , The value on the vertical axis is the MIDI value of pitch, and the note corresponding to a MIDI value of 60 is C4.
  • the melody curve of the new music is adjusted to generate an optimized music, and the melody of the generated optimized music is more unique, coherent and beautiful.
  • any position on the melody curve is randomly selected to modify the tune down; when it is detected that the melody curve has a continuous downward movement For positions exceeding three units, randomly select any position on the melody curve to modify the tune up.
  • the in-tune tones are inserted into the melody curve.
  • the penultimate unit of the melody curve is moved adjacently, such as: random tuning Move up or down.
  • the duration of the notes can also be modified accordingly to make the adjusted optimized music more coordinated.
  • obtaining a new piece of music it further includes: C1, obtaining user feedback information on the new piece of music, and adjusting at least one of the first music attribute information, the second music attribute information, and the candidate music segment based on the feedback information C2, based on at least one of the adjusted first music attribute information, adjusted second music attribute information, and adjusted candidate music segments, determine the adjusted music segment, and obtain the adjusted music segment based on the adjusted music segment Optimized music.
  • the new music has a shorter duration and faster speed, etc.
  • the feedback information correspondingly adjust the duration and speed of the new music, the first music attribute information and the second music attribute information of the new music
  • the obtained candidate music pieces will all change, and new music pieces generated based on different candidate music pieces will also be changed accordingly to form an optimized piece of music that is more in line with user needs.
  • the selection of candidate music fragments can also be adjusted according to the feedback information, that is, the selection criteria of the music fragments are adjusted, the final music fragments are adjusted based on the modified selection criteria, and the optimized music pieces more in line with the user's preferences are obtained based on the adjusted music fragments.
  • the adjustment of the candidate music piece may be performed on the basis of adjusting the first music attribute information or/and the second music attribute information, or the candidate music piece may be adjusted separately without adjusting the first music attribute information and the second music attribute information.
  • the solution provided by this embodiment is based on the feedback information provided by the user, using a negative feedback mechanism to adjust the music attributes, music fragments, etc. of the new music based on the feedback information provided by the user, and generate optimized music based on the adjusted music attributes or/and music fragments. Make the adjusted music more in line with user preferences.
  • an embodiment of the present application also provides a musical composition generating device 500.
  • the schematic structural diagram of the musical composition generating device 500 is shown in FIG. 5.
  • the musical composition generating device 500 includes a module 510 for obtaining first music attribute information, and a module for determining second music attribute information. 520.
  • the candidate music segment obtaining module 530 and the new music obtaining module 540 are specifically as follows.
  • the first music attribute information obtaining module 510 is configured to receive a first confirmation instruction, and obtain the first music attribute information and mood tag of the music according to the first confirmation instruction; the first confirmation instruction is for the first music attribute information and Confirm the selection of emotion tags.
  • the determining second music attribute information module 520 is configured to determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag.
  • the candidate music segment obtaining module 530 is configured to use the first music attribute information and the second music attribute information as filtering conditions to traverse a pre-built music database to obtain candidate music pieces that match the filtering conditions; wherein, the The music database stores a plurality of music pieces pre-divided according to music attributes.
  • the obtaining new music module 540 is configured to select music fragments from the candidate music fragments according to the received second confirmation instruction, and splice the music fragments in the order of the corresponding music bars to obtain a new music; wherein, the The second confirmation command is a selection confirmation command for the music segment.
  • the music generation method provided in the foregoing embodiment can be applied to an electronic device.
  • the electronic device 600 may be a terminal device with arithmetic function, such as a smart phone, a tablet computer, a portable computer, a desktop computer, and the like.
  • the electronic device includes a memory and a processor.
  • the processor here may be referred to as the processing device 601 below, and the memory may include a read-only memory (ROM) 602, a random access memory (RAM) 603, and a storage device 608 below.
  • ROM read-only memory
  • RAM random access memory
  • storage device 608 At least one item of is as follows.
  • the electronic device 600 may include a processing device (such as a central processing unit, a graphics processor, etc.) 601, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 602 or from a storage device 608.
  • the program in the memory (RAM) 603 executes various appropriate actions and processing.
  • various programs and data required for the operation of the electronic device 600 are also stored.
  • the processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604.
  • the following devices can be connected to the I/O interface 605: including input devices 606 such as touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, liquid crystal display (LCD), speakers, vibration An output device 607 such as a device; a storage device 608 such as a magnetic tape, a hard disk, etc.; and a communication device 609.
  • the communication device 609 may allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data.
  • FIG. 3 shows an electronic device 600 having various devices, it should be understood that it is not required to implement or have all of the illustrated devices. It may be implemented alternatively or provided with more or fewer devices.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602.
  • the processing device 601 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and server can use HTTP (HyperText Any currently known or future developed network protocol such as Hypertext Transfer Protocol for communication, and can be interconnected with any form or medium of digital data communication (for example, a communication network).
  • HTTP HyperText Any currently known or future developed network protocol such as Hypertext Transfer Protocol for communication
  • Examples of communication networks include local area networks ("LAN”), wide area networks ("WAN”), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future research and development network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device is caused to perform the following operations: receiving a first confirmation instruction, and obtaining music according to the first confirmation instruction
  • the first music attribute information and the emotion tag is a selection confirmation instruction for the first music attribute information and the emotion tag
  • the first confirmation instruction is a selection confirmation instruction for the first music attribute information and the emotion tag
  • based on the preset association relationship between the emotion tag and the music attribute and the emotion tag Determine the second music attribute information of the music
  • the The music database stores a plurality of music fragments pre-divided according to music attributes
  • the received second confirmation instruction a music fragment is selected from the candidate music fragments, and the music fragments are spliced in the order of the corresponding music sections, Obtain a new music piece
  • the second confirmation instruction is a selection confirmation instruction for a music
  • the embodiment of the present application also proposes a computer-readable storage medium.
  • the computer-readable medium may be a tangible medium, which may contain or store for use by the instruction execution system, apparatus, or equipment, or be used in conjunction with the instruction execution system, apparatus, or equipment.
  • the program used in combination may be a machine-readable signal medium or a machine-readable storage medium.
  • the computer-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing.
  • Computer-readable storage media More specific examples of computer-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium includes a music generation program, and when the music generation program is executed by a processor, the steps of the music generation method according to any one of the above technical solutions are implemented.
  • the storage medium involved in this application such as a computer-readable storage medium, may be non-volatile or volatile.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to the technical field of data processing, and in particular to a song generation method, an apparatus, an electronic device, and a storage medium. The song generation method comprises: receiving a first confirmation instruction, and on the basis of the first confirmation instruction, acquiring first musical attribute information and a mood tag for a song; on the basis of a preset association relationship between mood tags and musical properties and on the basis of the mood tag, determining second musical attribute information for the song; causing the first musical attribute information and the second musical attribute information to serve as filter conditions to traverse a pre-constructed music database, to acquire candidate musical segments matching the filter conditions; and on the basis of a received second confirmation instruction, selecting musical segments from among the candidate musical segments, and joining the musical segments according to a corresponding sequence of measures of music to acquire a new song. Using the method provided in the present application, new songs meeting a user's requirements can be controllably generated.

Description

乐曲生成方法、装置、电子设备及存储介质Music generating method, device, electronic equipment and storage medium
本申请要求于2020年5月29日提交中国专利局、申请号为202010478115.7,发明名称为“乐曲生成方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 29, 2020, the application number is 202010478115.7, and the invention title is "Music composition generation method, device, electronic equipment and storage medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及一种乐曲生成方法、装置、电子设备及存储介质。This application relates to the field of data processing technology, and in particular to a method, device, electronic device, and storage medium for generating music.
背景技术Background technique
对于音乐创作来说,需要创作人具备相应的乐理知识,使得很多热爱音乐的非专业人士不能创作出符合自己喜好的音乐。自动创作音乐旋律,尤其是自动创作具有特定风格和情感的完整旋律,一直是亟待解决的问题。For music creation, it is necessary for the creator to have the corresponding knowledge of music theory, so that many non-professionals who love music cannot create music that suits their preferences. Automatic creation of music melody, especially automatic creation of complete melody with specific style and emotion, has always been an urgent problem to be solved.
发明人发现,随着计算机技术的发展,已经有不少辅助工具出现来帮助非专业人士创作音乐,如:采用深度学习模型生成音乐,但该种方式创作出的音乐在专业性方面有所欠缺,生成的旋律具有一定的随机性,且无法复现音乐生成的过程,即无法实现可控地生成符合用户需求的音乐。The inventor found that with the development of computer technology, many auxiliary tools have appeared to help non-professionals create music. For example, deep learning models are used to generate music, but the music created in this way is lacking in professionalism. , The generated melody has a certain degree of randomness, and the process of music generation cannot be reproduced, that is, it is impossible to controllably generate music that meets the needs of users.
技术问题technical problem
本申请提供一种乐曲生成方法、电子设备及存储介质,其主要目的在于可控地生活才能符合用户需求的新乐曲。The present application provides a music generation method, electronic equipment, and storage medium, the main purpose of which is to live in a controlled manner to meet the needs of users with new music.
技术解决方案Technical solutions
本申请实施例首先提供了一种乐曲生成方法,包括如下步骤:接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。The embodiment of the present application first provides a method for generating music, including the following steps: receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of the music according to the first confirmation instruction; the first confirmation instruction is correct The first music attribute information and the selection confirmation instruction of the emotion tag; determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag; combine the first music attribute information with The second music attribute information is used as a filter condition to traverse the pre-built music database to obtain candidate music pieces matching the filter condition; wherein the music database stores a plurality of music pieces pre-divided according to the music attributes; The received second confirmation instruction selects a music fragment from the candidate music fragments, and splices the music fragments in the order of the corresponding music bars to obtain a new music piece; wherein, the second confirmation instruction is to select a music fragment Confirm the instruction.
相应地,本申请实施例还提供了一种乐曲生成装置,包括:获得第一音乐属性信息模块,用于接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;确定第二音乐属性信息模块,用于基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;获得候选音乐片段模块,用于将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;获得新乐曲模块,用于根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。Correspondingly, an embodiment of the present application also provides a music generating device, including: a first music attribute information obtaining module, configured to receive a first confirmation instruction, and obtain first music attribute information of the music according to the first confirmation instruction and Emotion tag; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and the emotion tag; the second music attribute information module is determined to be used based on the pre-set association relationship between the emotion tag and the music attribute and the The emotion tag determines the second music attribute information of the music; the obtaining candidate music segment module is used to traverse the pre-built music database using the first music attribute information and the second music attribute information as filtering conditions, and obtain the information corresponding to the filtering conditions. A matching candidate music piece; wherein the music database stores a plurality of music pieces pre-divided according to music attributes; a new music piece module is used to select from the candidate music pieces according to the received second confirmation instruction Music fragments, the music fragments are spliced in the order of corresponding music bars to obtain a new music piece; wherein, the second confirmation instruction is a selection confirmation instruction for the music fragment.
进一步地,本申请实施例还提供了一种电子设备,所述电子设备包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下方法:接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。Further, an embodiment of the present application also provides an electronic device, the electronic device includes: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the program The following method is implemented: receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of a music piece according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags; Determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag; use the first music attribute information and the second music attribute information as filter conditions to traverse the pre-built music A database to obtain candidate music pieces matching the screening conditions; wherein the music database stores a plurality of music pieces pre-divided according to music attributes; according to the received second confirmation instruction, from the candidate music pieces The music fragments are selected, and the music fragments are spliced in the order of the corresponding music bars to obtain a new music piece; wherein the second confirmation instruction is a selection confirmation instruction for the music fragment.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括乐曲生成程序,所述乐曲生成程序被处理器执行时,实现以下方法:接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。In addition, in order to achieve the above object, the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a music generation program, and when the music generation program is executed by a processor, the following method is implemented: Confirmation instruction, according to the first confirmation instruction to obtain the first music attribute information and emotion tag of the music; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tag; based on the preset emotion tag and The association relationship between the music attributes and the emotion tag determine the second music attribute information of the music; the first music attribute information and the second music attribute information are used as filtering conditions to traverse the pre-built music database to obtain the information related to the filtering Candidate music fragments matching the conditions; wherein the music database stores a plurality of music fragments pre-divided according to music attributes; according to the received second confirmation instruction, a music fragment is selected from the candidate music fragments, and the The music fragments are spliced in the order of the corresponding music bars to obtain a new music piece; wherein, the second confirmation instruction is a selection confirmation instruction for the music fragment.
有益效果Beneficial effect
本申请提供的第一确认指令是基于用户对音乐属性的选择,第二确认指令是基于用户对候选音乐片段的选择,利用第一确认指令及第二确认指令确定音乐片段,即新乐曲生成过程中音乐属性及音乐片段的确定均是基于用户选择,所以生成的乐曲与用户的喜好高度相关,乐曲生成过程中的人机交互性强,而且,与深度学习等方式相比,本申请生成的乐曲具有可控性以及乐曲的可重现性,即能够复现乐曲生成的过程。本申请提供的乐曲生成方法,预先针对海量的音乐数据样本按照音乐属性信息对音乐小节进行存储,获得音乐数据库,在生成乐曲的过程中,利用用户选定的音乐属性筛选与之相匹配的音乐片段,音乐片段中包括多个音乐小节,由于新乐曲是基于现有的音乐片段形成的,因此新乐曲的旋律符合和声走向,生成的乐曲具有连贯性。The first confirmation instruction provided in this application is based on the user's selection of music attributes, and the second confirmation instruction is based on the user's selection of candidate music fragments. The first confirmation instruction and the second confirmation instruction are used to determine the music fragment, that is, the process of generating new music. The determination of the music attributes and music fragments is based on user selection, so the generated music is highly related to the user’s preferences, and the human-computer interaction in the music generation process is strong. Moreover, compared with deep learning and other methods, the generated music is generated by this application. The music is controllable and reproducible, that is, it can reproduce the process of music generation. The music generation method provided in this application preliminarily stores music sections according to music attribute information for a large number of music data samples to obtain a music database. In the process of generating music, the music attributes selected by the user are used to filter matching music. Fragments, music fragments include multiple music bars. Since the new music is formed based on existing music fragments, the melody of the new music conforms to the harmony trend, and the generated music is coherent.
附图说明Description of the drawings
图1为本申请一种实施例提供的乐曲生成方法的流程图。FIG. 1 is a flowchart of a method for generating a music composition according to an embodiment of the application.
图2为本申请一种实施例提供的基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息的流程图。2 is a flowchart of determining second music attribute information of a music piece based on the association relationship between preset emotion tags and music attributes and the emotion tags according to an embodiment of the application.
图3为本申请一种实施例提供的valence-Arousal维度情感模型的示意图。FIG. 3 is a schematic diagram of a valence-Arousal dimensional emotion model provided by an embodiment of this application.
图4为本申请一种实施例提供的旋律曲线存在小幅度回旋,将所述旋律曲线中的中间音进行与调内音相反方向调整的示意图。FIG. 4 is a schematic diagram of a melody curve provided by an embodiment of the application with a small-amplitude gyration, and the middle tone in the melody curve is adjusted in the opposite direction to the tuning inner tone.
图5为本申请一种实施例提供的乐曲生成装置的结构示意图。FIG. 5 is a schematic structural diagram of a music generating device provided by an embodiment of the application.
图6为本申请一种实施例提供的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
本发明的实施方式Embodiments of the present invention
下面将参照附图更详细地描述本申请的实施例。虽然附图中显示了本申请的某些实施例,然而应当理解的是,本申请可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本申请。应当理解的是,本申请的附图及实施例仅用于示例性作用,并非用于限制本申请的保护范围。Hereinafter, embodiments of the present application will be described in more detail with reference to the accompanying drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided for Have a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of the present application are only used for exemplary purposes, and are not used to limit the protection scope of the present application.
应当理解,本申请的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本申请的范围在此方面不受限制。It should be understood that the steps described in the method embodiments of the present application may be executed in a different order, and/or executed in parallel. In addition, method implementations may include additional steps and/or omit to perform the illustrated steps. The scope of this application is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”;术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。The term "including" and its variants as used herein are open-ended includes, that is, "including but not limited to"; the term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." Related definitions of other terms will be given in the following description.
需要注意,本申请中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "a" and "multiple" mentioned in this application are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be interpreted as "one or Multiple".
本申请的技术方案可应用于人工智能、智慧城市、区块链和/或大数据技术领域。可选的,本申请涉及的数据如属性信息、标签和/或乐曲等可存储于数据库中,或者可以存储于区块链中,比如通过区块链分布式存储,本申请不做限定。The technical solution of this application can be applied to the fields of artificial intelligence, smart city, blockchain and/or big data technology. Optionally, the data involved in this application, such as attribute information, tags, and/or music, can be stored in a database, or can be stored in a blockchain, such as distributed storage through a blockchain, which is not limited in this application.
下面以具体实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
本申请实施例首先提供了一种乐曲生成方法,图1为本申请一种实施例提供的乐曲生成方法的流程图,该方法可以由一个装置执行,该装置可以由软件和/或硬件实现,该方法可以在用户端执行,用户端包括人机交互界面。The embodiment of the application first provides a method for generating music. Figure 1 is a flowchart of the method for generating music provided by an embodiment of the application. The method can be executed by a device, and the device can be implemented by software and/or hardware. The method can be executed on the user side, and the user side includes a human-computer interaction interface.
S110,接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令。S110: Receive a first confirmation instruction, and obtain first music attribute information and emotion tags of the music according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags.
S120,基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息。S120: Determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag.
S130,将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段。S130. Use the first music attribute information and the second music attribute information as filter conditions to traverse a pre-built music database to obtain candidate music pieces that match the filter conditions; wherein the music database stores pre-established music Multiple pieces of music divided by music attributes.
S140,根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。S140: Select a music fragment from the candidate music fragments according to the received second confirmation instruction, and splice the music fragments in the order of the corresponding music bars to obtain a new music piece; wherein the second confirmation instruction is right Confirm the selection of music fragments.
本申请提供的音乐属性至少包括如下信息:节奏型、速度、和弦、调性、调式、拍号、曲式结构、织体、配器等,按照音乐属性对乐曲的限定方向将音乐属性信息划分为第一音乐属性信息和第二音乐属性信息,第一音乐属性信息包括:乐曲类型、曲式结构、乐曲长度、调性、拍号,第二音乐属性信息包括:调式、和声走向、速度及节奏型信息。根据第一音乐属性信息能够确定乐曲的整体结构,根据第二音乐属性信息确定乐曲表达的情感。The music attributes provided in this application include at least the following information: rhythm type, speed, chord, key, mode, time signature, musical structure, texture, orchestration, etc. The music attribute information is divided into The first music attribute information and the second music attribute information. The first music attribute information includes: music type, structure, music length, key, time signature, and the second music attribute information includes: mode, harmony direction, speed, and Rhythm information. The overall structure of the music can be determined according to the first music attribute information, and the emotion expressed by the music can be determined according to the second music attribute information.
服务器端或者用户端接收到第一确认指令,第一确认指令为用户对第一音乐属性信息及情绪标签的选取确认指令,该第一确认指令可以是通过人机交互界面输入并通过客户端发送的对待生成乐曲的第一音乐属性信息及情绪标签的选取确认指令,该第一确认指令可以视为用户对第一音乐属性信息及情绪标签的选择,即第一音乐属性信息及情绪标签均可以为用户根据自身喜好选择的。The server or the client receives the first confirmation instruction, the first confirmation instruction is the user's selection confirmation instruction of the first music attribute information and emotion tag, the first confirmation instruction may be input through the human-computer interaction interface and sent through the client The selection confirmation instruction for the first music attribute information and emotion tag of the generated music, the first confirmation instruction can be regarded as the user's selection of the first music attribute information and emotion tag, that is, both the first music attribute information and emotion tag can be Selected for users according to their own preferences.
调用预先构建的情绪标签与音乐属性之间的关联关系,根据确定的情绪标签及该关联关系确定乐曲的第二音乐属性信息。The pre-built association relationship between the emotion tag and the music attribute is called, and the second music attribute information of the music piece is determined according to the determined emotion tag and the association relationship.
预先构建情绪标签与音乐属性之间的关联关系,情绪标签与音乐属性之间的关联关系,可以通过将情绪与节奏型信息或/和速度进行对应来体现,每个音乐小节的颗粒度都会影响旋律曲线的情绪表达,同时,在不同速度下相同的音符颗粒度可能有不同的情绪表达,因此,本方案在构建音乐数据库时对第二音乐属性信息与情绪标签进行了关联,例如:速度较快的音乐往往表达欢快的情绪,速度缓慢的音乐往往表达忧郁、悲伤的情绪等。Pre-construct the association relationship between emotion tags and music attributes. The association relationship between emotion tags and music attributes can be reflected by matching emotions with rhythmic information or/and speed. The granularity of each music section will affect The emotional expression of the melody curve. At the same time, the same note granularity may have different emotional expressions at different speeds. Therefore, this solution associates the second music attribute information with the emotional tags when constructing the music database, for example, the speed is relatively high. Fast music often expresses cheerful emotions, while slow music often expresses melancholy and sad emotions.
将第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得音乐数据库中与筛选条件相匹配的候选音乐片段,其中音乐数据库中存储有预先按照音乐属性划分的多个音乐片段。The first music attribute information and the second music attribute information are used as filter conditions to traverse the pre-built music database to obtain candidate music pieces matching the filter conditions in the music database. The music database stores a plurality of pre-divided music attributes. Music fragments.
在此之前,首先构建音乐数据库,过程如下:获取大量的音乐数据样本,这些音乐数据样本可以是根据用户的喜好选取的,以便最终生成的乐曲更加符合用户喜好,将音乐数据样本按照音乐小节划分为多个音乐片段,每个音乐片段包括多个连续的音乐小节,每个音乐小节上均有其所在乐曲的位置及编号,按照上述音乐属性分类存储所述音乐片段,构建起音乐数据库,所述音乐数据库也称为数据集字典。即音乐数据库为存储有音乐属性信息及音乐属性参数的字典,该字典可以按照节奏型-和弦这样的层级结构进行存储。Prior to this, first construct a music database, the process is as follows: obtain a large number of music data samples, these music data samples can be selected according to the user's preferences, so that the final generated music is more in line with the user's preferences, the music data samples are divided into music subsections It is a plurality of music fragments, each music fragment includes a plurality of continuous music bars, and each music bar has the position and number of the music in which it is located. The music fragments are classified and stored according to the above-mentioned music attributes, and a music database is constructed. The music database is also called a data set dictionary. That is, the music database is a dictionary storing music attribute information and music attribute parameters, and the dictionary can be stored in a hierarchical structure of rhythm-chords.
由于音乐数据库中存储有大量的音乐片段,且这些音乐片段的标识信息中包括有第一音乐属性信息和第二音乐属性信息,因此,通过用户选取的第一音乐属性信息和第二音乐属性信息作为筛选条件遍历音乐数据库,选取符合筛选条件的音乐片段,即筛选出与用户选取的第一音乐属性信和第二音乐属性信息相匹配的音乐片段,筛选出的多个音乐片段为候选音乐片段。Since a large number of music pieces are stored in the music database, and the identification information of these music pieces includes first music attribute information and second music attribute information, the first music attribute information and the second music attribute information selected by the user are used. The music database is traversed as a filter condition, and music pieces that meet the filter condition are selected, that is, music pieces that match the first music attribute information and the second music attribute information selected by the user are filtered out, and the multiple music pieces selected are candidate music pieces.
将多个候选音乐片段展示于人机交互界面上,接收用户对音乐片段的选取确认指令,接收并解析第二确认指令,根据第二确认指令的解析信息从多个候选音乐片段中选取音乐片段。Display multiple candidate music fragments on the human-computer interaction interface, receive the user's selection confirmation instruction of the music fragment, receive and analyze the second confirmation instruction, and select the music fragment from the multiple candidate music fragments according to the analysis information of the second confirmation instruction .
根据第二确认指令确定多个音乐片段,按照音乐片段中包括的音乐小节的顺序对音乐片段进行拼接,获得新乐曲。A plurality of music fragments are determined according to the second confirmation instruction, and the music fragments are spliced in the order of the music bars included in the music fragment to obtain a new music piece.
本申请提供的乐曲生成方法,将第一确认指令和第二确定指令作为筛选条件确定新乐曲的音乐片段,由于第一确认指令、第二确认指令分别为用户对第一音乐属性信息与情绪标签、候选音乐片段的选取确认指令,均能体现用户的喜好,因此,最终形成的新乐曲符合用户的喜好。而且,组成新乐曲的音乐片段是从音乐数据库中提取的,音乐数据库中存储的音乐片段均为现有音乐数据,因此,生成的新乐曲具有连贯性;进一步地,与利用深度学习等具有黑盒性质的生成方式相比,本方案生成新乐曲的路径可回溯,生成的新乐曲具有可控性及可重现性。In the music generation method provided by the present application, the first confirmation instruction and the second confirmation instruction are used as filter conditions to determine the music fragments of the new music, because the first confirmation instruction and the second confirmation instruction are the user’s response to the first music attribute information and the emotion tag, respectively. , The selection confirmation instructions of candidate music fragments can all reflect the user's preferences, therefore, the final new music composition conforms to the user's preferences. Moreover, the music fragments that make up the new music are extracted from the music database, and the music fragments stored in the music database are all existing music data. Therefore, the new music generated has continuity; further, it is not compatible with the use of deep learning. Compared with the box-like generation method, the path of generating new music in this scheme can be traced back, and the new music generated is controllable and reproducible.
为了更清楚本申请提供的日志信息的存储方案及其技术效果,接下来以多个实施例对其具体实施方案进行详细阐述。In order to be more clear about the log information storage solution provided by this application and its technical effects, the specific implementation solution will be described in detail with a number of embodiments in the following.
在一种实施例中,步骤S120中基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息的步骤,可以通过如图2所示的方式实现,包括如下子步骤。In an embodiment, in step S120, the step of determining the second music attribute information of the music based on the pre-set association relationship between the emotion tag and the music attribute and the emotion tag may be implemented as shown in FIG. 2 , Including the following sub-steps.
S210,通过预先构建的情感模型量化所述情绪标签。S210: Quantify the emotion label through a pre-built emotion model.
S220,根据量化后的情绪标签确定乐曲的候选第二音乐属性信息。S220: Determine candidate second music attribute information of the music piece according to the quantized emotion tag.
S230,接收并解析第三确认指令,根据所述第三确认指令的解析信息从所述候选第二音乐属性信息中确认乐曲的第二音乐属性信息,其中,所述第三确认指令是对第二音乐属性的选取确认指令。S230. Receive and analyze a third confirmation instruction, and confirm the second music attribute information of the music piece from the candidate second music attribute information according to the analysis information of the third confirmation instruction, wherein the third confirmation instruction is for the first 2. The selection confirmation command of the music attribute.
解析上述第一确认指令,确定用户选取的情绪标签,通过预先构建的情感模型量化所述情绪标签,所述情感模型可以为valence-Arousal维度情感模型,valence-Arousal维度情感模型的示意图如图3所示,该情感模型有两个维度,一个维度用来表示情感的正负性,如:高兴、生气等,另一维度表示情感的积极程度,如高兴对应的不同程度的情感,可以包括:满意、惊喜等表示高兴的程度,情感的正负性及其积极程度统称为用户的情绪标签,预先设置有情绪标签与音乐第二属性的关联关系,如表达高兴的情感,可以对应如下第二音乐属性信息:调式上扬,节奏明快等。Analyze the above-mentioned first confirmation instruction, determine the emotion label selected by the user, and quantify the emotion label through a pre-built emotion model. The emotion model may be a valence-Arousal dimensional emotion model. A schematic diagram of the valence-Arousal dimensional emotion model is shown in Figure 3 As shown, the emotion model has two dimensions. One dimension is used to express the positive and negative of emotions, such as happiness, anger, etc., and the other dimension represents the positive degree of emotions. For example, different levels of emotions corresponding to happiness can include: Satisfaction, surprise, etc. indicate the degree of happiness. The positive and negative of the emotion and its positive degree are collectively referred to as the user’s emotional label. The relationship between the emotional label and the second attribute of music is preset. For example, the expression of happy emotion can correspond to the following second Music attribute information: tune up, bright rhythm, etc.
基于用户在valence-Arousal维度情感模型中确定的情绪标签,结合情绪标签与第二属性之间的关联关系确定候选第二音乐属性信息。Based on the emotion label determined by the user in the valence-Arousal dimensional emotion model, the candidate second music attribute information is determined by combining the relationship between the emotion label and the second attribute.
具体地,用户可以在情感模型对应的坐标轴中选择任意一个点,根据数据统计分析能够确定该点的坐标对应的情绪标签,再根据预设的情绪标签与第二音乐属性信息之间的关联关系确定候选第二音乐属性信息,包括调式、和声走向、速度及节奏型信息。Specifically, the user can select any point in the coordinate axis corresponding to the emotion model, and determine the emotion label corresponding to the coordinate of the point according to the statistical analysis of the data, and then according to the association between the preset emotion label and the second music attribute information The relationship determines candidate second music attribute information, including mode, harmony direction, speed, and rhythm information.
具体地,首先对于情感模型的维度信息进行第二音乐属性对应的定义,假设模型存在四个边界点,再设置第二音乐属性与情感模型中任一点到各边界点的距离存在线性关系,即预先定义情感模型中任一点到各边界点的距离与音乐属性的对应关系。对于用户在模型空间内选择的任意点与各边界点进行距离计算后,根据相应的距离得到该点所对应的第二音乐属性信息。Specifically, first define the second music attribute corresponding to the dimensional information of the emotion model, assuming that the model has four boundary points, and then set the second music attribute to have a linear relationship with the distance from any point in the emotion model to each boundary point, namely The corresponding relationship between the distance from any point to each boundary point in the emotion model and the music attribute is defined in advance. After calculating the distance between any point selected by the user in the model space and each boundary point, the second music attribute information corresponding to the point is obtained according to the corresponding distance.
若所述候选第二音乐属性信息存在多个,则接收并解析对第二音乐属性信息的第三确认指令,根据第三确认指令的解析信息从所述候选第二音乐属性信中确定乐曲的第二音乐属性信息。If there are multiple candidate second music attribute information, then receive and analyze the third confirmation instruction for the second music attribute information, and determine the music composition from the candidate second music attribute information according to the analysis information of the third confirmation instruction Second music attribute information.
本实施方式提供的方案,利用情感模型量化情绪标签,根据量化后的情绪标签确定乐曲的第二音乐属性信息,实现根据情绪标签确定乐曲的第二音乐属性信息的目的。当根据情绪标签确定的候选第二音乐属性信息存在多个时,包括如下情况:存在多个与情绪标签相符的候选第二音乐属性信息,需要对多个候选第二音乐属性信息进行过滤或筛选,接收并解析用户端发送的对第二音乐属性信息的选取确认指令,即第三确认指令,根据第三确认指令的解析信息,从多个候选第二音乐属性信息中筛选出乐曲的第二音乐属性信息,由于第三确认指令是基于用户的选择,因此,筛选出的第二音乐属性信息符合用户喜好,且实现乐曲生成过程中的人机互动,提升用户体验。The solution provided by this embodiment uses an emotion model to quantify the emotion label, and determines the second music attribute information of the music according to the quantized emotion label, so as to achieve the purpose of determining the second music attribute information of the music according to the emotion label. When there are multiple candidate second music attribute information determined according to the emotion tag, it includes the following situations: there are multiple candidate second music attribute information that match the emotion tag, and the multiple candidate second music attribute information needs to be filtered or filtered , Receiving and analyzing the selection confirmation instruction of the second music attribute information sent by the user terminal, that is, the third confirmation instruction. According to the analysis information of the third confirmation instruction, the second music attribute information is selected from the multiple candidate second music attribute information. For the music attribute information, since the third confirmation instruction is based on the user's selection, the filtered second music attribute information meets the user's preference, and realizes the human-computer interaction in the music generation process, and improves the user experience.
一种可行的实施方式中,步骤S130中将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库的步骤,包括:A1、获取所述乐曲的配器信息;A2、根据所述第一音乐属性信息、所述第二音乐属性信息及所述配器信息遍历预先构建的音乐数据库。In a feasible implementation manner, the step of traversing a pre-built music database using the first music attribute information and the second music attribute information as filtering conditions in step S130 includes: A1, obtaining orchestration information of the music; A2 , Traverse a pre-built music database according to the first music attribute information, the second music attribute information, and the orchestrator information.
其中,配器信息包括给声部分配乐器,第一音乐属性信息、第二音乐属性信息及配器信息覆盖了一首乐曲的更多音乐属性信息,基于所述第一音乐属性信息、第二音乐属性信息及配器信息遍历所述音乐数据字典,筛选出与筛选条件相匹配的若干候选乐曲片段。Among them, the orchestration information includes the allocation of musical instruments to the parts, the first music attribute information, the second music attribute information, and the orchestration information cover more music attribute information of a piece of music, based on the first music attribute information and the second music attribute information. The information and orchestration information traverses the music data dictionary to filter out a number of candidate music pieces that match the filtering conditions.
将筛选条件中加入配器信息,综合第一音乐属性信息、第二音乐属性信息及配器信息遍历音乐数据库,能够减少从音乐数据库汇总筛选出的候选音乐片段的数量,有利于简化确定音乐片段的过程,且最终获得的音乐片段更加符合用户需求。Adding orchestration information to the screening conditions, and traversing the music database by integrating the first music attribute information, the second music attribute information and the orchestration information, can reduce the number of candidate music pieces that are collected and filtered from the music database, and help simplify the process of determining music pieces , And the finally obtained music fragments are more in line with user needs.
在一种可行的实施方式中,步骤S130中获得与所述筛选条件相匹配的候选音乐片段的步骤之后,还包括:B1、按照预设规则确定第一音乐属性信息与第二音乐属性信息中各音乐属性的匹配优先级;B2、按照各音乐属性的匹配优先级对所述候选音乐片段进行排序;B3、按照排序后的候选音乐片段。In a feasible implementation manner, after the step of obtaining candidate music pieces that match the filtering conditions in step S130, the method further includes: B1, determining the first music attribute information and the second music attribute information according to a preset rule Matching priority of each music attribute; B2, sort the candidate music pieces according to the matching priority of each music attribute; B3, sort the candidate music pieces according to the sorted.
按照预设规则对各音乐属性划分匹配优先级,音乐属性的匹配优先级由高到低可以依次为:曲式结构、和弦、节奏型、配器。若当前有若干候选音乐片段可供用户选择,可以首先按照曲式结构对候选音乐片段进行排序,在曲式结构相同的情况下,按照和弦对音乐片段排序,在曲式结构和和弦都相同的情况下,按照节奏型对音乐片段排序,以此类推。这些音乐属性是按照对乐曲的整体结构的影响大小进行排序,按照这种方式对候选音乐片段排序,有利于最终生成的乐曲更加符合用户需求。According to preset rules, the matching priority of each music attribute is divided, and the matching priority of the music attribute can be in order from high to low: musical structure, chord, rhythm pattern, orchestration. If there are currently several candidate music pieces for the user to choose from, you can first sort the candidate music pieces according to the music structure. In the case of the same music structure, sort the music pieces according to the chord. If the music structure and chord are the same In this case, the music clips are sorted according to the rhythm pattern, and so on. These music attributes are sorted according to their influence on the overall structure of the music. According to this method, the candidate music pieces are sorted, which is beneficial for the final generated music to be more in line with user needs.
对各候选音乐片段进行排序之后,根据接收到的第二确认指令从排序后的候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲。After sorting the candidate music fragments, a music fragment is selected from the sorted candidate music fragments according to the received second confirmation instruction, and the music fragments are spliced in the order of the corresponding music bars to obtain a new music piece.
在一种可行的实施方式中,按照上述方法针对乐曲的每个位置均建立排序后的候选音乐片段,对音乐片段按照对应的音乐小节顺序进行拼接的步骤,可以通过如下方式实现:将每个位置对应的排序最靠前的候选音乐片段按照其位置标识进行拼接。In a feasible implementation manner, according to the above method, a sorted candidate music segment is established for each position of the music, and the step of splicing the music segments in the order of the corresponding music subsections can be implemented in the following manner: The candidate music pieces with the highest ranking corresponding to the positions are spliced according to their position identifiers.
具体地,每个候选音乐片段上均设有标识信息,所述标识信息包括该音乐片段所属曲目(如:用曲目编号表征)、所在位置(如:用音乐小节在所属曲目中的位置编号表征)。Specifically, each candidate music piece is provided with identification information, and the identification information includes the track to which the music piece belongs (e.g., represented by a track number) and location (e.g., represented by the position number of the music section in the track to which it belongs) ).
若多个位置对应的候选音乐片段中均包含来自同一曲目,按照上述方法针对乐曲的每个位置均建立排序后的候选音乐片段,对音乐片段按照对应的音乐小节顺序进行拼接的步骤,包括:优选来自同一曲目的候选音乐片段进行拼接,以保证新乐曲的流畅度。If the candidate music fragments corresponding to multiple positions all contain the same track, the sorted candidate music fragments are created for each position of the music according to the above method, and the steps of splicing the music fragments according to the sequence of the corresponding music sections include: Preferably, candidate music pieces from the same song are spliced to ensure the fluency of the new music.
在一种可行的实施方式中,步骤S140的获得新乐曲的步骤之后,还包括:S150,获取所述新乐曲的旋律曲线,根据所述旋律曲线的曲线特征对所述旋律曲线进行调整,获得优化乐曲。In a feasible implementation manner, after the step of obtaining the new music in step S140, the method further includes: S150, obtaining the melody curve of the new music, and adjusting the melody curve according to the curve characteristics of the melody curve to obtain Optimize the music.
进一步地,本申请提供的乐曲生成方案,在生成新乐曲之后,根据曲线特征对旋律曲线的调整,使得调整后的优化乐曲的旋律更加独特。Furthermore, in the music composition generation solution provided by the present application, after a new music composition is generated, the melody curve is adjusted according to the curve characteristics, so that the melody of the adjusted optimized music composition is more unique.
其中,这里的旋律曲线可以包括音符信息、音高信息等,所述曲线特征,如:旋律曲线存在连续上行(或下行)超过三个单位的位置、旋律曲线存在小幅度回旋、相邻单位的曲线斜率大于预设阈值、连续超过三个单位的音符音高相同等。Among them, the melody curve here may include note information, pitch information, etc. The characteristics of the curve, such as: the melody curve has a position where the melody curve has continuous upward (or downward) more than three units, the melody curve has a small-amplitude convolution, and the adjacent unit The slope of the curve is greater than the preset threshold, the pitch of the notes that exceed three consecutive units is the same, and so on.
具体地,根据曲线特征对旋律曲线进行调整的步骤,包括:当检测到所述旋律曲线存在小幅度回旋,将所述旋律曲线中的中间音进行与调内音相反方向的调整。Specifically, the step of adjusting the melody curve according to the curve characteristics includes: when it is detected that the melody curve has a small-amplitude gyration, adjusting the middle tone in the melody curve in the opposite direction to the inner tone of the tuning.
旋律曲线存在小幅度回旋,如图4所示,相连两个音在所选调内为相邻音,则对于中间音进行调内音相反方向的修改,如:原上行回旋,则修改为下行回旋,反之亦然,若所选音高组成为[do,re,do],则将该音高组成修改为[do,si,do],该调整过程如图4中实线框所示,其中,纵轴的数值为音高的MIDI值,MIDI值为60对应的音符为C4。The melody curve has a small convolution, as shown in Figure 4, if the two consecutive tones are adjacent in the selected key, the middle tone is modified in the opposite direction of the tone, such as: the original upward convolution, then it is modified to the downward convolution , And vice versa, if the selected pitch composition is [do,re,do], modify the pitch composition to [do,si,do], the adjustment process is shown in the solid line box in Figure 4, where , The value on the vertical axis is the MIDI value of pitch, and the note corresponding to a MIDI value of 60 is C4.
根据本实施方式提供的方案调整新乐曲的旋律曲线生成优化乐曲,生成的优化乐曲的旋律更加独特,连贯、优美。According to the solution provided by this embodiment, the melody curve of the new music is adjusted to generate an optimized music, and the melody of the generated optimized music is more unique, coherent and beautiful.
在一种可行的实施方式中,当检测到旋律曲线存在连续上行超过三个单位的位置,随机选取该段旋律曲线上的任意位置进行调内音下移修改;当检测到旋律曲线存在连续下行超过三个单位的位置,随机选取该段旋律曲线上的任意位置进行调内音上移修改。In a feasible implementation manner, when it is detected that the melody curve has a continuous upward movement of more than three units, any position on the melody curve is randomly selected to modify the tune down; when it is detected that the melody curve has a continuous downward movement For positions exceeding three units, randomly select any position on the melody curve to modify the tune up.
在一种可行的实施方式中,当检测到旋律曲线上相邻单位的曲线斜率大于预设阈值,则在该旋律曲线中插入调内音。In a feasible implementation manner, when it is detected that the curve slopes of adjacent units on the melody curve are greater than the preset threshold, the in-tune tones are inserted into the melody curve.
在一种可行的实施方式中,当检测到连续超过三个单位的音符音高相同,则对该段旋律曲线的倒数第二个单位进行相邻调内音移动,如:随机进行调内音的上移或下移。In a feasible implementation, when it is detected that more than three consecutive units of notes have the same pitch, the penultimate unit of the melody curve is moved adjacently, such as: random tuning Move up or down.
通过上述实施方式对新乐曲的旋律曲线进行调整,获得更加独特的优化乐曲。By adjusting the melody curve of the new music through the above-mentioned implementation manner, a more unique optimized music can be obtained.
在此基础上,还可以对音符的时长进行相应修改,使得调整后的优化乐曲更加协调。On this basis, the duration of the notes can also be modified accordingly to make the adjusted optimized music more coordinated.
进一步地,获得新乐曲之后,还包括:C1、获取用户对所述新乐曲的反馈信息,基于所述反馈信息调整第一音乐属性信息、第二音乐属性信息、候选音乐片段中的至少一项;C2、基于调整后的第一音乐属性信息、调整后的第二音乐属性信息、调整后的候选音乐片段中的至少一项,确定调整后的音乐片段,基于调整后的音乐片段获得调整后的优化乐曲。Further, after obtaining a new piece of music, it further includes: C1, obtaining user feedback information on the new piece of music, and adjusting at least one of the first music attribute information, the second music attribute information, and the candidate music segment based on the feedback information C2, based on at least one of the adjusted first music attribute information, adjusted second music attribute information, and adjusted candidate music segments, determine the adjusted music segment, and obtain the adjusted music segment based on the adjusted music segment Optimized music.
获取用户对新乐曲的反馈信息,如:新乐曲的时长较短、速度较快等,根据反馈信息对应调整新乐曲的时长、速度等,新乐曲的第一音乐属性信息、第二音乐属性信息中的任一因素改变之后,获得的候选音乐片段均会出现改变,基于不同的候选音乐片段生成的新乐曲也会相应更改,形成更加符合用户需求的优化乐曲。Obtain the user's feedback information on the new music, such as: the new music has a shorter duration and faster speed, etc., according to the feedback information, correspondingly adjust the duration and speed of the new music, the first music attribute information and the second music attribute information of the new music After any one of the factors in is changed, the obtained candidate music pieces will all change, and new music pieces generated based on different candidate music pieces will also be changed accordingly to form an optimized piece of music that is more in line with user needs.
还可以根据反馈信息调整对候选音乐片段的选取,即调整音乐片段的选取标准,基于修改后的选取标准调整最终确定的音乐片段,基于调整后的音乐片段获得更加符合用户喜好后的优化乐曲。对候选音乐片段的调整可以在调整第一音乐属性信息或/和第二音乐属性信息的基础上进行,也可以单独调整候选音乐片段,而不调整第一音乐属性信息和第二音乐属性信息。The selection of candidate music fragments can also be adjusted according to the feedback information, that is, the selection criteria of the music fragments are adjusted, the final music fragments are adjusted based on the modified selection criteria, and the optimized music pieces more in line with the user's preferences are obtained based on the adjusted music fragments. The adjustment of the candidate music piece may be performed on the basis of adjusting the first music attribute information or/and the second music attribute information, or the candidate music piece may be adjusted separately without adjusting the first music attribute information and the second music attribute information.
本实施方式提供的方案基于用户提供的反馈信息,利用负反馈机制,基于用户提供的反馈信息调整新乐曲的音乐属性、音乐片段等,根据调整后的音乐属性或/和音乐片段生成优化乐曲,使得调整后的乐曲更加符合用户喜好。The solution provided by this embodiment is based on the feedback information provided by the user, using a negative feedback mechanism to adjust the music attributes, music fragments, etc. of the new music based on the feedback information provided by the user, and generate optimized music based on the adjusted music attributes or/and music fragments. Make the adjusted music more in line with user preferences.
相应地,本申请一种实施例还提供了一种乐曲生成装置500,其结构示意图如图5所示,乐曲生成装置500包括:获得第一音乐属性信息模块510、确定第二音乐属性信息模块520、获得候选音乐片段模块530、获得新乐曲模块540,具体如下。Correspondingly, an embodiment of the present application also provides a musical composition generating device 500. The schematic structural diagram of the musical composition generating device 500 is shown in FIG. 5. The musical composition generating device 500 includes a module 510 for obtaining first music attribute information, and a module for determining second music attribute information. 520. The candidate music segment obtaining module 530 and the new music obtaining module 540 are specifically as follows.
获得第一音乐属性信息模块510,用于接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令。The first music attribute information obtaining module 510 is configured to receive a first confirmation instruction, and obtain the first music attribute information and mood tag of the music according to the first confirmation instruction; the first confirmation instruction is for the first music attribute information and Confirm the selection of emotion tags.
确定第二音乐属性信息模块520,用于基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息。The determining second music attribute information module 520 is configured to determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag.
获得候选音乐片段模块530,用于将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段。The candidate music segment obtaining module 530 is configured to use the first music attribute information and the second music attribute information as filtering conditions to traverse a pre-built music database to obtain candidate music pieces that match the filtering conditions; wherein, the The music database stores a plurality of music pieces pre-divided according to music attributes.
获得新乐曲模块540,用于根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。The obtaining new music module 540 is configured to select music fragments from the candidate music fragments according to the received second confirmation instruction, and splice the music fragments in the order of the corresponding music bars to obtain a new music; wherein, the The second confirmation command is a selection confirmation command for the music segment.
关于上述实施例中的乐曲生成装置,其中各个模块的执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the music generating device in the foregoing embodiment, the specific manner of performing operations of each module therein has been described in detail in the embodiment of the method, and detailed description will not be given here.
上述实施例提供的乐曲生成方法,可以应用于一种电子设备中。其结构示意图参照图6所示。The music generation method provided in the foregoing embodiment can be applied to an electronic device. Refer to Figure 6 for a schematic diagram of the structure.
在本实施例中,电子设备600可以是智能手机、平板电脑、便携计算机、桌上型计算机等具有运算功能的终端设备。In this embodiment, the electronic device 600 may be a terminal device with arithmetic function, such as a smart phone, a tablet computer, a portable computer, a desktop computer, and the like.
电子设备包括:存储器以及处理器,其中,这里的处理器可以称为下文的处理装置601,存储器可以包括下文中的只读存储器(ROM)602、随机访问存储器(RAM)603以及存储装置608中的至少一项,具体如下所示。The electronic device includes a memory and a processor. The processor here may be referred to as the processing device 601 below, and the memory may include a read-only memory (ROM) 602, a random access memory (RAM) 603, and a storage device 608 below. At least one item of is as follows.
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processor, etc.) 601, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 602 or from a storage device 608. The program in the memory (RAM) 603 executes various appropriate actions and processing. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to the bus 604.
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图3示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Generally, the following devices can be connected to the I/O interface 605: including input devices 606 such as touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, liquid crystal display (LCD), speakers, vibration An output device 607 such as a device; a storage device 608 such as a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data. Although FIG. 3 shows an electronic device 600 having various devices, it should be understood that it is not required to implement or have all of the illustrated devices. It may be implemented alternatively or provided with more or fewer devices.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and server can use HTTP (HyperText Any currently known or future developed network protocol such as Hypertext Transfer Protocol for communication, and can be interconnected with any form or medium of digital data communication (for example, a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future research and development network of.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行如下操作:接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to perform the following operations: receiving a first confirmation instruction, and obtaining music according to the first confirmation instruction The first music attribute information and the emotion tag; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and the emotion tag; based on the preset association relationship between the emotion tag and the music attribute and the emotion tag Determine the second music attribute information of the music; use the first music attribute information and the second music attribute information as filter conditions to traverse a pre-built music database to obtain candidate music pieces that match the filter conditions; wherein, the The music database stores a plurality of music fragments pre-divided according to music attributes; according to the received second confirmation instruction, a music fragment is selected from the candidate music fragments, and the music fragments are spliced in the order of the corresponding music sections, Obtain a new music piece; wherein, the second confirmation instruction is a selection confirmation instruction for a music piece.
此外,本申请实施例还提出一种计算机可读存储介质,计算机可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。计算机可读介质可以是机器可读信号介质或机器可读储存介质。计算机可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。计算机可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。所述计算机可读存储介质中包括乐曲生成程序,所述乐曲生成程序被处理器执行时实现上述任一项技术方案所述的乐曲生成方法的步骤。In addition, the embodiment of the present application also proposes a computer-readable storage medium. The computer-readable medium may be a tangible medium, which may contain or store for use by the instruction execution system, apparatus, or equipment, or be used in conjunction with the instruction execution system, apparatus, or equipment. The program used in combination. The computer-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The computer-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. The computer-readable storage medium includes a music generation program, and when the music generation program is executed by a processor, the steps of the music generation method according to any one of the above technical solutions are implemented.
可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。Optionally, the storage medium involved in this application, such as a computer-readable storage medium, may be non-volatile or volatile.
本申请之计算机可读存储介质的具体实施方式与上述乐曲生成方法、电子设备的具体实施方式大致相同,在此不再赘述。The specific implementation of the computer-readable storage medium of the present application is substantially the same as the specific implementation of the aforementioned music generation method and electronic device, and will not be repeated here.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the application, and do not limit the scope of the patent for this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of the application, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (20)

  1. 一种乐曲生成方法,其中,包括:A method for generating music, which includes:
    接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;Receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of the music piece according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags;
    基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;Determining the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag;
    将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;The first music attribute information and the second music attribute information are used as filtering conditions to traverse a pre-built music database to obtain candidate music pieces that match the filtering conditions; wherein, the music database stores the music data in advance according to the music attributes. Multiple music fragments divided;
    根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。According to the received second confirmation instruction, a music fragment is selected from the candidate music fragments, and the music fragments are spliced in the order of the corresponding music sections to obtain a new music piece; wherein, the second confirmation instruction is for the music fragment To confirm the command.
  2. 根据权利要求1所述的乐曲生成方法,其中,所述获得新乐曲的步骤之后,还包括:The method of generating a music composition according to claim 1, wherein after the step of obtaining a new music composition, the method further comprises:
    获取所述新乐曲的旋律曲线,根据所述旋律曲线的曲线特征对所述旋律曲线进行调整,获得优化乐曲。The melody curve of the new music composition is acquired, and the melody curve is adjusted according to the curve characteristics of the melody curve to obtain an optimized music composition.
  3. 根据权利要求2所述的乐曲生成方法,其中,所述根据曲线特征对所述旋律曲线进行调整的步骤,包括:The music generating method according to claim 2, wherein the step of adjusting the melody curve according to the curve characteristics comprises:
    检测到所述旋律曲线存在小幅度回旋,将所述旋律曲线中的中间音进行与调内音相反方向的调整。It is detected that there is a small-amplitude gyration in the melody curve, and the middle tone in the melody curve is adjusted in the opposite direction to the inner tone.
  4. 根据权利要求1所述的乐曲生成方法,其中,所述基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息的步骤,包括:The music composition generation method according to claim 1, wherein the step of determining the second music attribute information of the music based on the pre-set association relationship between the emotion tag and the music attribute and the emotion tag comprises:
    通过预先构建的情感模型量化所述情绪标签;Quantifying the emotion label through a pre-built emotion model;
    根据量化后的情绪标签确定乐曲的候选第二音乐属性信息;Determining candidate second music attribute information of the music piece according to the quantized emotion tag;
    接收并解析第三确认指令,根据所述第三确认指令的解析信息从所述候选第二音乐属性信息中确定乐曲的第二音乐属性信息,其中,所述第三确认指令是对第二音乐属性的选取确认指令。A third confirmation instruction is received and analyzed, and the second music attribute information of the music piece is determined from the candidate second music attribute information according to the analysis information of the third confirmation instruction, wherein the third confirmation instruction is for the second music Confirm the selection of attributes.
  5. 根据权利要求1所述的乐曲生成方法,其中,所述将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库步骤,包括:The music generation method according to claim 1, wherein the step of using the first music attribute information and the second music attribute information as filtering conditions to traverse a pre-built music database comprises:
    获取所述乐曲的配器信息;Acquiring orchestration information of the music;
    根据所述第一音乐属性信息、所述第二音乐属性信息及所述配器信息遍历预先构建的音乐数据库。Traverse a pre-built music database according to the first music attribute information, the second music attribute information, and the orchestrator information.
  6. 根据权利要求1所述的乐曲生成方法,其中,所述获得与所述筛选条件相匹配的候选音乐片段的步骤之后,还包括:2. The music generation method according to claim 1, wherein after the step of obtaining candidate music fragments matching the screening conditions, the method further comprises:
    按照预设规则确定第一音乐属性信息与第二音乐属性信息中各音乐属性的匹配优先级;Determining the matching priority of each music attribute in the first music attribute information and the second music attribute information according to a preset rule;
    按照各音乐属性的匹配优先级对所述候选音乐片段进行排序;Sorting the candidate music fragments according to the matching priority of each music attribute;
    获取排序后的候选音乐片段;Obtain the sorted candidate music fragments;
    所述根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲,包括:The selecting a music fragment from the candidate music fragments according to the received second confirmation instruction, and splicing the music fragments in the order of corresponding music bars to obtain a new music composition, including:
    根据接收到的第二确认指令从排序后的候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲。According to the received second confirmation instruction, music fragments are selected from the sorted candidate music fragments, and the music fragments are spliced in the order of corresponding music bars to obtain a new music piece.
  7. 根据权利要求1所述的乐曲生成方法,其中,所述获得新乐曲的步骤之后,还包括:The method of generating a music composition according to claim 1, wherein after the step of obtaining a new music composition, the method further comprises:
    获取用户对所述新乐曲的反馈信息,基于所述反馈信息调整第一音乐属性信息、第二音乐属性信息、候选音乐片段中的至少一项;Acquiring user feedback information for the new music, and adjusting at least one of first music attribute information, second music attribute information, and candidate music fragments based on the feedback information;
    基于调整后的第一音乐属性信息、调整后的第二音乐属性信息、调整后候选音乐片段中的至少一项,确定调整后的音乐片段,基于调整后的音乐片段获得调整后的优化乐曲。Based on at least one of the adjusted first music attribute information, the adjusted second music attribute information, and the adjusted candidate music segment, the adjusted music segment is determined, and the adjusted optimized music piece is obtained based on the adjusted music segment.
  8. 一种乐曲生成装置,其中,包括:A music generating device, which includes:
    获得第一音乐属性信息模块,用于接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;The module for obtaining first music attribute information is configured to receive a first confirmation instruction, and obtain the first music attribute information and mood tag of the music according to the first confirmation instruction; the first confirmation instruction is for the first music attribute information and mood The selection confirmation command of the label;
    确定第二音乐属性信息模块,用于基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;Determining the second music attribute information module, configured to determine the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag;
    获得候选音乐片段模块,用于将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;The candidate music piece obtaining module is used to traverse a pre-built music database using the first music attribute information and the second music attribute information as filtering conditions to obtain candidate music pieces matching the filtering conditions; wherein, the music A plurality of music fragments pre-divided according to music attributes are stored in the database;
    获得新乐曲模块,用于根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。The acquiring new music module is used to select music fragments from the candidate music fragments according to the received second confirmation instruction, and to splice the music fragments in the order of the corresponding music bars to obtain a new music; wherein, the first The second confirmation command is the selection confirmation command for the music piece.
  9. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现以下方法:An electronic device includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the following method when the program is executed:
    接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;Receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of the music piece according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags;
    基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;Determining the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag;
    将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;The first music attribute information and the second music attribute information are used as filtering conditions to traverse a pre-built music database to obtain candidate music pieces that match the filtering conditions; wherein, the music database stores the music data in advance according to the music attributes. Multiple music fragments divided;
    根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。According to the received second confirmation instruction, a music fragment is selected from the candidate music fragments, and the music fragments are spliced in the order of the corresponding music sections to obtain a new music piece; wherein, the second confirmation instruction is for the music fragment To confirm the command.
  10. 根据权利要求9所述的电子设备,其中,所述获得新乐曲的步骤之后,所述处理器执行所述程序时还用于实现:9. The electronic device according to claim 9, wherein after the step of obtaining a new music, the processor is further configured to implement:
    获取所述新乐曲的旋律曲线,根据所述旋律曲线的曲线特征对所述旋律曲线进行调整,获得优化乐曲。The melody curve of the new music composition is acquired, and the melody curve is adjusted according to the curve characteristics of the melody curve to obtain an optimized music composition.
  11. 根据权利要求10所述的电子设备,其中,所述根据曲线特征对所述旋律曲线进行调整的步骤时,具体实现:11. The electronic device according to claim 10, wherein the step of adjusting the melody curve according to the curve characteristics specifically implements:
    检测到所述旋律曲线存在小幅度回旋,将所述旋律曲线中的中间音进行与调内音相反方向的调整。It is detected that there is a small-amplitude gyration in the melody curve, and the middle tone in the melody curve is adjusted in the opposite direction to the inner tone.
  12. 根据权利要求9所述的电子设备,其中,所述基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息的步骤时,具体实现:9. The electronic device according to claim 9, wherein the step of determining the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag is specifically implemented:
    通过预先构建的情感模型量化所述情绪标签;Quantifying the emotion label through a pre-built emotion model;
    根据量化后的情绪标签确定乐曲的候选第二音乐属性信息;Determining candidate second music attribute information of the music piece according to the quantized emotion tag;
    接收并解析第三确认指令,根据所述第三确认指令的解析信息从所述候选第二音乐属性信息中确定乐曲的第二音乐属性信息,其中,所述第三确认指令是对第二音乐属性的选取确认指令。A third confirmation instruction is received and analyzed, and the second music attribute information of the music piece is determined from the candidate second music attribute information according to the analysis information of the third confirmation instruction, wherein the third confirmation instruction is for the second music Confirm the selection of attributes.
  13. 根据权利要求9所述的电子设备,其中,所述获得与所述筛选条件相匹配的候选音乐片段的步骤之后,所述处理器执行所述程序时还用于实现:9. The electronic device according to claim 9, wherein after the step of obtaining candidate music pieces that match the screening conditions, the processor is further configured to implement:
    按照预设规则确定第一音乐属性信息与第二音乐属性信息中各音乐属性的匹配优先级;Determining the matching priority of each music attribute in the first music attribute information and the second music attribute information according to a preset rule;
    按照各音乐属性的匹配优先级对所述候选音乐片段进行排序;Sorting the candidate music fragments according to the matching priority of each music attribute;
    获取排序后的候选音乐片段;Obtain the sorted candidate music fragments;
    所述根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲时,具体实现:When the music fragment is selected from the candidate music fragments according to the received second confirmation instruction, and the music fragments are spliced in the order of the corresponding music bars to obtain a new music piece, the specific implementation is as follows:
    根据接收到的第二确认指令从排序后的候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲。According to the received second confirmation instruction, music fragments are selected from the sorted candidate music fragments, and the music fragments are spliced in the order of corresponding music bars to obtain a new music piece.
  14. 根据权利要求9所述的电子设备,其中,所述获得新乐曲的步骤之后,所述处理器执行所述程序时还用于实现:9. The electronic device according to claim 9, wherein after the step of obtaining a new music, the processor is further configured to implement:
    获取用户对所述新乐曲的反馈信息,基于所述反馈信息调整第一音乐属性信息、第二音乐属性信息、候选音乐片段中的至少一项;Acquiring user feedback information for the new music, and adjusting at least one of first music attribute information, second music attribute information, and candidate music fragments based on the feedback information;
    基于调整后的第一音乐属性信息、调整后的第二音乐属性信息、调整后候选音乐片段中的至少一项,确定调整后的音乐片段,基于调整后的音乐片段获得调整后的优化乐曲。Based on at least one of the adjusted first music attribute information, the adjusted second music attribute information, and the adjusted candidate music segment, the adjusted music segment is determined, and the adjusted optimized music piece is obtained based on the adjusted music segment.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质中包括乐曲生成程序,所述乐曲生成程序被处理器执行时,实现以下方法:A computer-readable storage medium, wherein the computer-readable storage medium includes a music generation program, and when the music generation program is executed by a processor, the following method is implemented:
    接收第一确认指令,根据所述第一确认指令获得乐曲的第一音乐属性信息及情绪标签;所述第一确认指令是对第一音乐属性信息及情绪标签的选取确认指令;Receiving a first confirmation instruction, and obtaining first music attribute information and emotion tags of the music piece according to the first confirmation instruction; the first confirmation instruction is a selection confirmation instruction for the first music attribute information and emotion tags;
    基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息;Determining the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag;
    将所述第一音乐属性信息和第二音乐属性信息作为筛选条件遍历预先构建的音乐数据库,获得与所述筛选条件相匹配的候选音乐片段;其中,所述音乐数据库中存储有预先按照音乐属性划分的多个音乐片段;The first music attribute information and the second music attribute information are used as filtering conditions to traverse a pre-built music database to obtain candidate music pieces that match the filtering conditions; wherein, the music database stores the music data in advance according to the music attributes. Multiple music fragments divided;
    根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲;其中,所述第二确认指令是对音乐片段的选取确认指令。According to the received second confirmation instruction, a music fragment is selected from the candidate music fragments, and the music fragments are spliced in the order of the corresponding music sections to obtain a new music piece; wherein, the second confirmation instruction is for the music fragment To confirm the command.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述获得新乐曲的步骤之后,所述乐曲生成程序被处理器执行时还用于实现:15. The computer-readable storage medium according to claim 15, wherein after the step of obtaining a new music composition, when the music composition generation program is executed by the processor, it is further used to realize:
    获取所述新乐曲的旋律曲线,根据所述旋律曲线的曲线特征对所述旋律曲线进行调整,获得优化乐曲。The melody curve of the new music composition is acquired, and the melody curve is adjusted according to the curve characteristics of the melody curve to obtain an optimized music composition.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述根据曲线特征对所述旋律曲线进行调整的步骤时,具体实现:The computer-readable storage medium according to claim 16, wherein the step of adjusting the melody curve according to the curve characteristics specifically implements:
    检测到所述旋律曲线存在小幅度回旋,将所述旋律曲线中的中间音进行与调内音相反方向的调整。It is detected that there is a small-amplitude gyration in the melody curve, and the middle tone in the melody curve is adjusted in the opposite direction to the inner tone.
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述基于预先设置的情绪标签与音乐属性之间的关联关系以及所述情绪标签确定乐曲的第二音乐属性信息的步骤时,具体实现:The computer-readable storage medium according to claim 15, wherein the step of determining the second music attribute information of the music based on the preset association relationship between the emotion tag and the music attribute and the emotion tag is specifically implemented :
    通过预先构建的情感模型量化所述情绪标签;Quantifying the emotion label through a pre-built emotion model;
    根据量化后的情绪标签确定乐曲的候选第二音乐属性信息;Determining candidate second music attribute information of the music piece according to the quantized emotion tag;
    接收并解析第三确认指令,根据所述第三确认指令的解析信息从所述候选第二音乐属性信息中确定乐曲的第二音乐属性信息,其中,所述第三确认指令是对第二音乐属性的选取确认指令。A third confirmation instruction is received and analyzed, and the second music attribute information of the music piece is determined from the candidate second music attribute information according to the analysis information of the third confirmation instruction, wherein the third confirmation instruction is for the second music Confirm the selection of attributes.
  19. 根据权利要求15所述的计算机可读存储介质,其中,所述获得与所述筛选条件相匹配的候选音乐片段的步骤之后,所述乐曲生成程序被处理器执行时还用于实现:15. The computer-readable storage medium according to claim 15, wherein after the step of obtaining candidate music pieces matching the filtering conditions, when the music composition generation program is executed by the processor, it is further used to realize:
    按照预设规则确定第一音乐属性信息与第二音乐属性信息中各音乐属性的匹配优先级;Determining the matching priority of each music attribute in the first music attribute information and the second music attribute information according to a preset rule;
    按照各音乐属性的匹配优先级对所述候选音乐片段进行排序;Sorting the candidate music fragments according to the matching priority of each music attribute;
    获取排序后的候选音乐片段;Obtain the sorted candidate music fragments;
    所述根据接收到的第二确认指令从所述候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲时,具体实现:When the music fragment is selected from the candidate music fragments according to the received second confirmation instruction, and the music fragments are spliced in the order of the corresponding music bars to obtain a new music piece, the specific implementation is as follows:
    根据接收到的第二确认指令从排序后的候选音乐片段中选取音乐片段,对所述音乐片段按照对应的音乐小节的顺序进行拼接,获得新乐曲。According to the received second confirmation instruction, music fragments are selected from the sorted candidate music fragments, and the music fragments are spliced in the order of corresponding music bars to obtain a new music piece.
  20. 根据权利要求15所述的计算机可读存储介质,其中,所述获得新乐曲的步骤之后,所述乐曲生成程序被处理器执行时还用于实现:15. The computer-readable storage medium according to claim 15, wherein after the step of obtaining a new music composition, when the music composition generation program is executed by the processor, it is further used to realize:
    获取用户对所述新乐曲的反馈信息,基于所述反馈信息调整第一音乐属性信息、第二音乐属性信息、候选音乐片段中的至少一项;Acquiring user feedback information for the new music, and adjusting at least one of first music attribute information, second music attribute information, and candidate music fragments based on the feedback information;
    基于调整后的第一音乐属性信息、调整后的第二音乐属性信息、调整后候选音乐片段中的至少一项,确定调整后的音乐片段,基于调整后的音乐片段获得调整后的优化乐曲。Based on at least one of the adjusted first music attribute information, the adjusted second music attribute information, and the adjusted candidate music segment, the adjusted music segment is determined, and the adjusted optimized music piece is obtained based on the adjusted music segment.
PCT/CN2020/134835 2020-05-29 2020-12-09 Song generation method, apparatus, electronic device, and storage medium WO2021115311A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010478115.7 2020-05-29
CN202010478115.7A CN111680185A (en) 2020-05-29 2020-05-29 Music generation method, music generation device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
WO2021115311A1 true WO2021115311A1 (en) 2021-06-17

Family

ID=72453277

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/134835 WO2021115311A1 (en) 2020-05-29 2020-12-09 Song generation method, apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN111680185A (en)
WO (1) WO2021115311A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210241731A1 (en) * 2020-01-31 2021-08-05 Obeebo Labs Ltd. Systems, devices, and methods for assigning mood labels to musical compositions

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680185A (en) * 2020-05-29 2020-09-18 平安科技(深圳)有限公司 Music generation method, music generation device, electronic device and storage medium
CN113763910A (en) * 2020-11-25 2021-12-07 北京沃东天骏信息技术有限公司 Music generation method and device
CN112634843A (en) * 2020-12-28 2021-04-09 四川新网银行股份有限公司 Information generation method and device for expressing data in voice mode
CN112837664B (en) * 2020-12-30 2023-07-25 北京达佳互联信息技术有限公司 Song melody generation method and device and electronic equipment
CN112785993B (en) * 2021-01-15 2024-04-12 杭州网易云音乐科技有限公司 Music generation method, device, medium and computing equipment
CN113035162A (en) * 2021-03-22 2021-06-25 平安科技(深圳)有限公司 National music generation method, device, equipment and storage medium
CN113096624B (en) * 2021-03-24 2023-07-25 平安科技(深圳)有限公司 Automatic creation method, device, equipment and storage medium for symphony music

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108806655A (en) * 2017-04-26 2018-11-13 微软技术许可有限责任公司 Song automatically generates
CN109887095A (en) * 2019-01-22 2019-06-14 华南理工大学 A kind of emotional distress virtual reality scenario automatic creation system and method
US10321842B2 (en) * 2014-04-22 2019-06-18 Interaxon Inc. System and method for associating music with brain-state data
CN110599985A (en) * 2018-06-12 2019-12-20 阿里巴巴集团控股有限公司 Audio content generation method, server side equipment and client side equipment
CN111680185A (en) * 2020-05-29 2020-09-18 平安科技(深圳)有限公司 Music generation method, music generation device, electronic device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2073193A1 (en) * 2007-12-17 2009-06-24 Sony Corporation Method and device for generating a soundtrack
CN110148393B (en) * 2018-02-11 2023-12-15 阿里巴巴集团控股有限公司 Music generation method, device and system and data processing method
CN109102787B (en) * 2018-09-07 2022-09-27 王国欣 Simple automatic background music creating system
CN110808019A (en) * 2019-10-31 2020-02-18 维沃移动通信有限公司 Song generation method and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10321842B2 (en) * 2014-04-22 2019-06-18 Interaxon Inc. System and method for associating music with brain-state data
CN108806655A (en) * 2017-04-26 2018-11-13 微软技术许可有限责任公司 Song automatically generates
CN110599985A (en) * 2018-06-12 2019-12-20 阿里巴巴集团控股有限公司 Audio content generation method, server side equipment and client side equipment
CN109887095A (en) * 2019-01-22 2019-06-14 华南理工大学 A kind of emotional distress virtual reality scenario automatic creation system and method
CN111680185A (en) * 2020-05-29 2020-09-18 平安科技(深圳)有限公司 Music generation method, music generation device, electronic device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210241731A1 (en) * 2020-01-31 2021-08-05 Obeebo Labs Ltd. Systems, devices, and methods for assigning mood labels to musical compositions

Also Published As

Publication number Publication date
CN111680185A (en) 2020-09-18

Similar Documents

Publication Publication Date Title
WO2021115311A1 (en) Song generation method, apparatus, electronic device, and storage medium
US11562722B2 (en) Cognitive music engine using unsupervised learning
US10109264B2 (en) Composing music using foresight and planning
US20210247954A1 (en) Audio Techniques for Music Content Generation
CN109165302A (en) Multimedia file recommendation method and device
US10460763B2 (en) Generating audio loops from an audio track
US20200160821A1 (en) Information processing method
US20220262328A1 (en) Musical composition file generation and management system
US20220043876A1 (en) Systems and methods for recommending collaborative content
CN115885276A (en) Comparative training for music generators
US20210034661A1 (en) Systems and methods for recommending collaborative content
Liu Literature survey of multi-track music generation model based on generative confrontation network in intelligent composition
Chen et al. Automatic composition of Guzheng (Chinese Zither) music using long short-term memory network (LSTM) and reinforcement learning (RL)
CN109741724A (en) Make the method, apparatus and intelligent sound of song
CN116959393A (en) Training data generation method, device, equipment and medium of music generation model
US20210350778A1 (en) Method and system for processing audio stems
Yu Research on multimodal music emotion recognition method based on image sequence
Brunner et al. Neural symbolic music genre transfer insights
KR20240028353A (en) Selection of supplementary audio segments based on video analysis
CN113763910A (en) Music generation method and device
Chen et al. Music Generation using Deep Learning with Spectrogram Analysis
US11830463B1 (en) Automated original track generation engine
KR102625795B1 (en) System and Method for Searching of Similar sound source based on Artificial Intelligence
Singh Sifting sound interactive extraction, exploration, and expressive recombination of large and heterogeneous audio collections
De Prisco et al. Creative DNA computing: splicing systems for music composition

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20898207

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20898207

Country of ref document: EP

Kind code of ref document: A1