CN112309435A - Method and device for generating main melody, electronic equipment and storage medium - Google Patents

Method and device for generating main melody, electronic equipment and storage medium Download PDF

Info

Publication number
CN112309435A
CN112309435A CN202011194180.3A CN202011194180A CN112309435A CN 112309435 A CN112309435 A CN 112309435A CN 202011194180 A CN202011194180 A CN 202011194180A CN 112309435 A CN112309435 A CN 112309435A
Authority
CN
China
Prior art keywords
lyric
pitch
note
tone
generating
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011194180.3A
Other languages
Chinese (zh)
Inventor
顾宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
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 Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202011194180.3A priority Critical patent/CN112309435A/en
Publication of CN112309435A publication Critical patent/CN112309435A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/90Pitch determination of speech signals
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H1/00Details of electrophonic musical instruments
    • G10H1/0008Associated control or indicating means
    • G10H1/0025Automatic or semi-automatic music composition, e.g. producing random music, applying rules from music theory or modifying a musical piece
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/90Pitch determination of speech signals
    • G10L2025/906Pitch tracking

Abstract

The application discloses a method and a device for generating a main melody, electronic equipment and a storage medium. The method comprises the following steps: acquiring a lyric text, wherein the lyric text comprises the tone of each lyric; generating a note sequence according to the song-editing instruction; and correcting the pitch of the note sequence according to the lyric text to obtain the main melody matched with the lyric text. The pitch of the note sequence generated according to the song composing instruction is corrected through a lyric text containing the tone of the lyric, so that the pitch of the note sequence is determined through the tone of the lyric to improve the singing performance of the main melody and enable the generated main melody to accord with the singing habit of the user.

Description

Method and device for generating main melody, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of data processing, and in particular, to a method and an apparatus for generating a main melody, an electronic device, and a storage medium.
Background
Along with the rapid development of Artificial Intelligence (AI), AI music composing is increasingly developed, and AI music composing is based on a composition model trained by adopting a large number of music songs, so that the model can automatically generate music phonemes such as a main melody, a chord and an accompaniment through a known algorithm according to the requirements of a user.
Because the pitch of the main melody is randomly determined in the process of generating the main melody at present, the pitch may not be standard, for example, notes corresponding to a plurality of adjacent lyrics in the main melody are all the same pitch, which obviously does not conform to the singing habit of the user, so that the singing performance of the generated main melody is low, and the requirement of the user cannot be met.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for generating a main melody, electronic equipment and a storage medium, so as to obtain the main melody matched with the tone of lyrics.
In a first aspect, an embodiment of the present disclosure provides a method for generating a main melody, where the method includes:
acquiring a lyric text, wherein the lyric text comprises the tone of each lyric;
generating a note sequence according to the song-editing instruction;
and correcting the pitch of the note sequence according to the lyric text to obtain the main melody matched with the lyric text.
In a second aspect, an embodiment of the present disclosure further provides an apparatus for generating a main melody, where the apparatus includes:
the lyric text acquisition module is used for acquiring a lyric text, wherein the lyric text comprises the tone of each lyric;
the musical note sequence generating module is used for generating a musical note sequence according to the song-composing instruction;
and the main melody generating module is used for correcting the pitch of the note sequence according to the lyric text to obtain the main melody matched with the lyric text.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement a method according to any embodiment of the present disclosure.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements a method according to any of the embodiments of the present disclosure.
In the embodiment of the disclosure, the pitch of the note sequence generated according to the song editing instruction is corrected by the lyric text containing the tone of the lyric, so that the pitch of the note sequence is determined by the tone of the lyric to improve the singing performance of the main melody and enable the generated main melody to conform to the singing habit of the user.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1(a) is a flowchart of a method for generating a main melody according to an embodiment of the present disclosure;
FIG. 1(b) is a schematic diagram of different pitches of the same note on the wireless spectrum according to the embodiment of the present disclosure;
fig. 2(a) is a flowchart of another main melody generation method provided by the embodiment of the disclosure;
FIG. 2(b) is a schematic diagram illustrating the corrected main melody according to the embodiment of the disclosure;
FIG. 3 is a schematic structural diagram of an apparatus for generating a main melody according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
Fig. 1(a) is a flowchart of a method for generating a main melody according to an embodiment of the present disclosure, which may be applied to a case of acquiring a main melody matched with a tone of a lyric, and may be performed by an apparatus for generating a main melody according to an embodiment of the present disclosure, which may be implemented in software and/or hardware, and may be generally integrated in a computer device. The method of the embodiment of the disclosure specifically comprises the following steps:
as shown in fig. 1(a), the method in the embodiments of the present disclosure may include the following steps:
step 101, obtaining a lyric text.
Specifically, the embodiment can be applied to an electronic device, the electronic device comprises a human-computer interaction interface, a user inputs a composition instruction through operation on the human-computer interaction interface, and the electronic device displays a lyric filling position on the human-computer interaction interface when acquiring the composition instruction, so that the user can manually input lyrics and lyric tone at the displayed lyric filling position. The electronic equipment responds to the input operation of a user and obtains a lyric text, wherein the lyric text comprises the tone of each lyric.
The tone refers to the variation of the elevation and subsidence of the sound, and may also be called as a word tone, and generally includes one sound-one yin and one flat, and is represented by "-"; diphone-yang, denoted by "d"; triphone-up, denoted by "ˇ"; four tones-go-down, denoted by.
In the present embodiment, each lyric is polled, whether the tone of the polled lyric is up or down relative to the tone of the immediately preceding lyric is determined, and if the tone is up, the polled lyric is marked with a plus sign "+" and if the tone is down, the polled lyric is marked with a minus sign "-". In this case, the tone-raising finger raises the sound at the time of reading, for example, two tones are raised relative to one tone.
For example, in the embodiment, if the acquired lyric text is "i love home", the first lyric "i" is three tones, the second lyric "i" is four tones, the third lyric "ancestor" is three tones, and the fourth lyric "home" is two tones. Since "love" is in ascending tone relative to "me", it is possible to mark "+" on "love" of lyrics, and "ancestor" is in descending tone relative to "love", it is possible to mark "-" on "ancestor" of lyrics, and "country" is in ascending tone relative to "ancestor", and it is possible to mark "+" on "country" of lyrics. It is to be understood that this embodiment is merely an example in which the tone of the lyric text includes four lyrics, and the specific number of lyrics included in the lyric text is not limited in this embodiment.
And 102, generating a note sequence according to the composition instruction.
Optionally, generating the note sequence according to the composition instruction may include: generating a random number according to a song composition instruction, wherein the song composition instruction comprises the lyric number of a lyric text; and generating a note sequence according to the random number, wherein each lyric corresponds to a note group, and the note group at least comprises one note.
Optionally, generating a random number according to the composition instruction may include: and randomly generating a note vector with a specified dimension according to the song-composing instruction, and taking the note vector as the random number.
Specifically, the composition instruction may also be input by a user through a human-computer interaction interface, and the composition instruction includes the number of lyrics of a previously input lyric text, and is obtained in response to an instruction input operation of the user. The electronic device may generate a note vector of a specified dimension according to the composition instruction, the note vector including note features, and generate a note sequence according to the random number using the note vector as the random number.
For example, in the present embodiment, each lyric corresponds to one note group, and the note group includes one note. Determining the random number generated according to the composing instruction when the specified dimension is determined to be 4-dimensional
Figure BDA0002753519620000061
The random number includes 4 rows and 4 columns, that is, each row corresponds to the characteristic information of one note, so that a note sequence including 4 notes can be obtained. Wherein, the corresponding note in the first row can be a quarter note
Figure BDA0002753519620000069
The second row corresponds to octant notes
Figure BDA0002753519620000062
The third row corresponds to two octant notes
Figure BDA0002753519620000063
The fourth row corresponds to a sixteenth note
Figure BDA0002753519620000064
Therefore, the sequence of notes includes four notes. Since in this embodimentThe example that each lyric corresponds to one note group and the note group comprises one note is taken as an example for explanation, so that the corresponding note of the lyric 'me' can be determined
Figure BDA0002753519620000065
Corresponding to love
Figure BDA0002753519620000066
"ancestor" corresponds to
Figure BDA0002753519620000067
"state" corresponds to
Figure BDA0002753519620000068
Of course, the initial pitch of each note can also be determined and known from the note vector, and in practical applications, the types of pitch include: do, Ri, Mi, Fa, Sol, La, Xi, and can be used to mark the location of notes on the radio spectrum, as shown in fig. 1(b) for a representation of different pitches of the same note on the radio spectrum. However, the initial pitch obtained at this time is inaccurate and needs to be adjusted subsequently in combination with the tone of the lyrics.
And 103, correcting the pitch of the note sequence according to the lyric text to obtain the main melody matched with the lyric text.
Optionally, correcting the pitch of the note sequence according to the lyric text to obtain the main melody matched with the lyric text, which may include: acquiring preset number of pitches, wherein the sizes of the pitches are different; generating a probability set of pitch for each note group, wherein the probability set comprises probability values adopting different pitches; and correcting the pitch of each note group according to the probability set to obtain the main melody matched with the lyric text.
Specifically, in this embodiment, after the note sequence is obtained, in order to ensure the sunability of the main melody determined according to the note sequence, the pitch of the generated note sequence needs to be corrected, specifically, the pitch of the note corresponding to each lyric is related to the tone of the previous lyric, and if the current lyric is in the tone relative to the tone of the previous lyric, the pitch of the corresponding note is also increased accordingly. Thereby making the main melody determined by the note more vocal.
In the embodiment of the disclosure, the pitch of the note sequence generated according to the song editing instruction is corrected by the lyric text containing the tone of the lyric, so that the pitch of the note sequence is determined by the tone of the lyric to improve the singing performance of the main melody and enable the generated main melody to conform to the singing habit of the user.
Example two
Fig. 2 is a flowchart of another main melody generation method provided in the second embodiment of the present disclosure, which may be combined with various alternatives in the foregoing embodiments, and in the second embodiment of the present disclosure, a process of obtaining a main melody matched with a lyric text by correcting a pitch of a note sequence according to the lyric text is specifically described.
As shown in fig. 2(a), the method of the embodiment of the present disclosure specifically includes:
step 201, obtaining a lyric text.
Wherein, the lyric text contains the tone of each lyric
Step 202, generating a note sequence according to the composition instruction.
Step 203, acquiring a preset number of pitches.
Wherein the size of each pitch is different.
Specifically, in this embodiment, the preset number of pitches may be 7, which are Do, Ri, Mi, Fa, Sol, La, and Xi, and the pitches are different in size and gradually increase according to the above sorting. The size of pitch mainly refers to the frequency of pitch, i.e. the size of frequency can be used to represent the size of pitch.
In step 204, a probability set of pitch is generated for each note group.
Wherein, the probability set comprises probability values adopting different pitches.
In particular, a set of probabilities of pitch can be generated for each note group, e.g., for the first noteA quarter note
Figure BDA0002753519620000083
The probability value of each note group selecting each pitch can be determined through a posterior probability calculation, and a plurality of probability values of different pitches are adopted to form a probability set corresponding to each note group. For example, the corresponding note of the lyric "me" is a quarter note
Figure BDA0002753519620000082
The probability set corresponding to the note is determined by calculation to be { p (do) ═ 0.05 p (ri) ═ 0.05 p (mi) ═ 0.3 p (fa) ═ 0.4p (sol) ═ 0.1 p (la) ═ 0.02 p (xi) ═ 0.08 }. The determination method of the probability set corresponding to other notes is substantially the same, and therefore, the description thereof is omitted in this embodiment.
And step 205, correcting the pitch of each note group according to the probability set to obtain the main melody matched with the lyric text.
Optionally, correcting the pitch of each note group according to the probability set may include: randomly selecting a probability value from the probability set aiming at the note group corresponding to the first lyric, and taking the pitch corresponding to the selected probability value as the pitch of the note group corresponding to the first lyric; and aiming at the note group corresponding to the current lyrics except the first lyrics, determining the pitch of the note group corresponding to the current lyrics according to the tone of the current lyrics, the tone of the adjacent previous lyrics and the probability set.
Optionally, determining the pitch of the note group corresponding to the current lyric according to the tone of the current lyric, the tone of the adjacent previous lyric and the probability set, may include: deleting the pitch determined by the note group of the lyrics larger than the previous lyrics from the probability set corresponding to the note group of the current lyrics when the tone of the current lyrics is determined to be pitch reduction relative to the tone of the previous lyrics adjacent to the current lyrics; and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
Specifically, the note group corresponding to the first lyric may be directly selected from the probability set as the maximum probability value, and the pitch corresponding to the maximum probability value may be used as the pitch of the note group corresponding to the first lyric, for example, the note corresponding to the lyric "me" is a quarter note
Figure BDA0002753519620000093
And the probability set corresponding to the note is { p (do) ═ 0.05 p (ri) ═ 0.05 p (mi) ═ 0.3 p (Fa) ═ 0.4p (sol) ═ 0.1 p (la) ═ 0.02 p (xi) ═ 0.08}, so that Fa is the pitch of the note. The pitch of the following note group is determined by referring to the tone of the lyric corresponding to the note group and the tone of the adjacent previous lyric.
For example, the note corresponding to the second lyric "love" is determined to be an eighth note
Figure BDA0002753519620000091
And the probability set corresponding to the note is { p (do) ═ 0.04 p (ri) ═ 0.06 p (mi) ═ 0.4p (fa) ═ 0.1 p (sol) ═ 0.3 p (la) ═ 0.02 p (xi) ═ 0.08 }. Since the lyric "love" is marked as "+", it can be determined that the tone of the current lyric "love" is rising relative to the tone of the adjacent previous lyric "me", a pitch smaller than Fa is deleted from the probability set corresponding to the note group of the current lyric, a new probability set { p (Fa) ═ 0.1 p (Sol) ═ 0.3 p (la) ═ 0.02 p (xi) ═ 0.08} is obtained, and the pitch Sol with the largest probability value is selected from the remaining pitches, and the Sol is taken as the pitch of the note corresponding to the lyric "love". It can be seen that even though the probability of Mi is the greatest, no selection is made because pitch Mi is less than pitch Fa.
Similarly, the third lyric "ancestor" corresponds to two octant notes
Figure BDA0002753519620000092
And the probability set corresponding to the note is { p (do) ═ 0.03 p (ri) ═ 0.07 p (mi) ═ 0.2 p (fa) ═ 0.1 p (sol) ═0.1 p (la) 0.4p (xi) 0.1 }. Since the lyric "ancestor" is marked as "-", it can be determined that the tone of the current lyric "ancestor" is down relative to the tone of the adjacent previous lyric "love", the pitch greater than Sol is deleted from the probability set corresponding to the note group of the current lyric, a new probability set { p (do) ═ 0.03 p (ri) ═ 0.07 p (Mi) ═ 0.2 p (fa) ═ 0.1 p (Sol) ═ 0.1} is obtained, and the pitch Mi with the highest probability value is selected from the remaining pitches, and Mi is taken as the pitch of the note corresponding to the lyric "ancestor". The pitch of the note corresponding to the lyric "country" can be determined to be Do according to the same principle, and the principle is substantially the same as the above process, so the details are not repeated in this embodiment. Fig. 2(b) is a schematic diagram of the corrected main melody in the present embodiment.
In the embodiment of the disclosure, the pitch of the note sequence generated according to the song editing instruction is corrected by the lyric text containing the tone of the lyric, so that the pitch of the note sequence is determined by the tone of the lyric to improve the singing performance of the main melody and enable the generated main melody to conform to the singing habit of the user.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a main melody generating device according to a third embodiment of the present disclosure. The apparatus may be implemented in software and/or hardware and may generally be integrated in an electronic device performing the method. As shown in fig. 3, the apparatus may include:
the lyric text acquiring module 310 is configured to acquire a lyric text, where the lyric text includes a tone of each lyric;
a note sequence generating module 320, configured to generate a note sequence according to the composition instruction;
and the main melody generating module 330 is configured to correct the pitch of the note sequence according to the lyric text, and obtain a main melody matched with the lyric text.
Optionally, on the basis of the above technical solution, the note sequence generating module includes:
the random number generation sub-module is used for generating a random number according to the song composition instruction, wherein the song composition instruction comprises the lyric number of the lyric text;
and the musical note sequence generation sub-module is used for generating the musical note sequence according to the random number, wherein each lyric corresponds to a musical note group, and the musical note group at least comprises one musical note.
Optionally, on the basis of the above technical solution, the random number generation sub-module is configured to:
and randomly generating a note vector with a specified dimension according to the composing instruction, and taking the note vector as the random number.
Optionally, on the basis of the above technical solution, the main melody generating module includes:
the preset number of pitch acquisition sub-modules are used for acquiring the preset number of pitches, wherein the sizes of the pitches are different;
the pitch probability set acquisition submodule is used for respectively generating a pitch probability set aiming at each note group, wherein the probability set comprises probability values adopting different pitches;
and the main melody obtaining sub-module is used for correcting the pitch of each note group according to the probability set to obtain the main melody matched with the lyric text.
Optionally, on the basis of the above technical solution, the main melody obtaining sub-module includes:
a first pitch correction subunit, configured to randomly select a probability value from the probability set for a note group corresponding to the first lyric, and use a pitch corresponding to the selected probability value as a pitch of the note group corresponding to the first lyric;
and the second pitch correction subunit is used for determining the pitch of the note group corresponding to the current lyric according to the tone of the current lyric, the tone of the adjacent previous lyric and the probability set aiming at the note group corresponding to the current lyric except the first lyric.
Optionally, on the basis of the foregoing technical solution, the second pitch syndrome unit is configured to:
deleting the pitch determined by the note group larger than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be off tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
Optionally, on the basis of the foregoing technical solution, the second pitch syndrome unit is configured to:
deleting the pitch determined by the note group smaller than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be rising tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
In the embodiment of the disclosure, the pitch of the note sequence generated according to the song editing instruction is corrected by the lyric text containing the tone of the lyric, so that the pitch of the note sequence is determined by the tone of the lyric to improve the singing performance of the main melody and enable the generated main melody to conform to the singing habit of the user.
The device for generating the main melody provided by the embodiment of the present disclosure is the same as the method for generating the main melody provided by the above embodiments, and the technical details that are not described in detail in the embodiment of the present disclosure can be referred to the above embodiments, and the embodiment of the present disclosure has the same beneficial effects as the above embodiments.
Example four
Referring now to FIG. 4, a block diagram of an electronic device 400 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device in the embodiment of the present disclosure may be a device corresponding to a backend service platform of an application program, and may also be a mobile terminal device installed with an application program client. In particular, the electronic device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), etc., and a stationary terminal such as a digital TV, a desktop computer, etc. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, electronic device 400 may include a processing device (e.g., central processing unit, graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the internal processes of the electronic device to perform: acquiring a lyric text, wherein the lyric text comprises the tone of each lyric; generating a note sequence according to the song-editing instruction; and correcting the pitch of the note sequence according to the lyric text to obtain the main melody matched with the lyric text.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, [ example 1 ] there is provided a method of generating a melody, including:
acquiring a lyric text, wherein the lyric text comprises the tone of each lyric;
generating a note sequence according to the song-editing instruction;
and correcting the pitch of the note sequence according to the lyric text to obtain a main melody matched with the lyric text.
According to one or more embodiments of the present disclosure, [ example 2 ] there is provided the method of example 1, the generating a sequence of musical notes according to a composition instruction, comprising:
generating a random number according to the song composition instruction, wherein the song composition instruction comprises the lyric number of the lyric text;
and generating the note sequence according to the random number, wherein each lyric corresponds to a note group respectively, and the note group at least comprises one note.
According to one or more embodiments of the present disclosure, [ example 3 ] there is provided the method of example 2, the generating a random number according to the composition instruction, comprising:
and randomly generating a note vector with a specified dimension according to the composing instruction, and taking the note vector as the random number.
According to one or more embodiments of the present disclosure, [ example 4 ] there is provided the method of example 3, the correcting a pitch of the sequence of notes according to the lyric text, obtaining a main melody matched with the lyric text, comprising:
acquiring preset number of pitches, wherein the sizes of the pitches are different;
generating a probability set of pitches for each note group, wherein the probability set comprises probability values of different pitches;
and correcting the pitch of each note group according to the probability set to obtain the main melody matched with the lyric text.
According to one or more embodiments of the present disclosure, [ example 5 ] there is provided the method of example 4, the correcting the pitch of each note group according to the set of probabilities, comprising:
randomly selecting a probability value from the probability set aiming at the note group corresponding to the first lyric, and taking the pitch corresponding to the selected probability value as the pitch of the note group corresponding to the first lyric;
and aiming at a note group corresponding to the current lyrics except the first lyrics, determining the pitch of the note group corresponding to the current lyrics according to the tone of the current lyrics, the tone of the adjacent previous lyrics and the probability set.
According to one or more embodiments of the present disclosure, [ example 6 ] there is provided the method of example 5, the determining a pitch of a note group to which the current lyric corresponds according to the pitch of the current lyric and the pitch of an adjacent previous lyric and the probability set, comprising:
deleting the pitch determined by the note group larger than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be off tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
According to one or more embodiments of the present disclosure, [ example 7 ] there is provided the method of example 5, the determining a pitch of a group of notes to which the current lyric corresponds according to the pitch of the current lyric and an adjacent previous lyric and the set of probabilities, comprising:
deleting the pitch determined by the note group smaller than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be rising tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
According to one or more embodiments of the present disclosure, [ example 8 ] there is provided a main melody generating apparatus including:
the lyric text acquisition module is used for acquiring a lyric text, wherein the lyric text comprises the tone of each lyric;
the musical note sequence generating module is used for generating a musical note sequence according to the song-composing instruction;
and the main melody generating module is used for correcting the pitch of the note sequence according to the lyric text to obtain a main melody matched with the lyric text.
According to one or more embodiments of the present disclosure, [ example 9 ] there is provided the apparatus of example 8, the musical note sequence generating module comprising:
the random number generation sub-module is used for generating a random number according to the song composition instruction, wherein the song composition instruction comprises the lyric number of the lyric text;
and the musical note sequence generation sub-module is used for generating the musical note sequence according to the random number, wherein each lyric corresponds to a musical note group, and the musical note group at least comprises one musical note.
In accordance with one or more embodiments of the present disclosure, [ example 10 ] there is provided the apparatus of example 9, the random number generation submodule to:
and randomly generating a note vector with a specified dimension according to the composing instruction, and taking the note vector as the random number.
According to one or more embodiments of the present disclosure, [ example 11 ] there is provided the apparatus of example 10, the melody generation module comprising:
the preset number of pitch acquisition sub-modules are used for acquiring the preset number of pitches, wherein the sizes of the pitches are different;
the pitch probability set acquisition submodule is used for respectively generating a pitch probability set aiming at each note group, wherein the probability set comprises probability values adopting different pitches;
and the main melody obtaining sub-module is used for correcting the pitch of each note group according to the probability set to obtain the main melody matched with the lyric text.
According to one or more embodiments of the present disclosure, [ example 12 ] there is provided the apparatus of example 11, the melody acquisition sub-module comprising:
a first pitch correction subunit, configured to randomly select a probability value from the probability set for a note group corresponding to the first lyric, and use a pitch corresponding to the selected probability value as a pitch of the note group corresponding to the first lyric;
and the second pitch correction subunit is used for determining the pitch of the note group corresponding to the current lyric according to the tone of the current lyric, the tone of the adjacent previous lyric and the probability set aiming at the note group corresponding to the current lyric except the first lyric.
According to one or more embodiments of the present disclosure, [ example 13 ] there is provided the apparatus of example 12, the second pitch syndrome unit to:
deleting the pitch determined by the note group larger than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be off tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
According to one or more embodiments of the present disclosure, [ example 14 ] there is provided the apparatus of example 12, the second pitch syndrome unit to:
deleting the pitch determined by the note group smaller than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be rising tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
According to one or more embodiments of the present disclosure, [ example 15 ] there is provided an electronic device comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of examples 1-7.
According to one or more embodiments of the present disclosure, [ example 16 ] there is provided a storage medium containing computer executable instructions, having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the method as in any of examples 1-7.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A method for generating a main melody, comprising:
acquiring a lyric text, wherein the lyric text comprises the tone of each lyric;
generating a note sequence according to the song-editing instruction;
and correcting the pitch of the note sequence according to the lyric text to obtain a main melody matched with the lyric text.
2. The method of claim 1, wherein generating a sequence of musical notes according to a composition instruction comprises:
generating a random number according to the song composition instruction, wherein the song composition instruction comprises the lyric number of the lyric text;
and generating the note sequence according to the random number, wherein each lyric corresponds to a note group respectively, and the note group at least comprises one note.
3. The method of claim 2, wherein generating a random number according to the composition instruction comprises:
and randomly generating a note vector with a specified dimension according to the composing instruction, and taking the note vector as the random number.
4. The method of claim 3, wherein the correcting the pitch of the sequence of notes according to the lyric text to obtain the main melody matched with the lyric text comprises:
acquiring preset number of pitches, wherein the sizes of the pitches are different;
generating a probability set of pitches for each note group, wherein the probability set comprises probability values of different pitches;
and correcting the pitch of each note group according to the probability set to obtain the main melody matched with the lyric text.
5. A method as claimed in claim 4, wherein said correcting the pitch of each note group according to the set of probabilities comprises:
randomly selecting a probability value from the probability set aiming at the note group corresponding to the first lyric, and taking the pitch corresponding to the selected probability value as the pitch of the note group corresponding to the first lyric;
and aiming at a note group corresponding to the current lyrics except the first lyrics, determining the pitch of the note group corresponding to the current lyrics according to the tone of the current lyrics, the tone of the adjacent previous lyrics and the probability set.
6. The method of claim 5, wherein determining the pitch of the group of notes corresponding to the current lyric according to the pitch of the current lyric and the pitch of the adjacent previous lyric and the set of probabilities comprises:
deleting the pitch determined by the note group larger than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be off tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
7. The method of claim 5, wherein determining the pitch of the note group corresponding to the current lyric according to the pitch of the current lyric and the pitch of the adjacent previous lyric and the set of probabilities comprises:
deleting the pitch determined by the note group smaller than the previous lyric from the probability set corresponding to the note group of the current lyric when the tone of the current lyric is determined to be rising tone relative to the tone of the adjacent previous lyric;
and selecting the pitch with the maximum probability value from the rest pitches, and taking the selected pitch as the pitch corresponding to the note group of the current lyric.
8. A device for generating a melody, comprising:
the lyric text acquisition module is used for acquiring a lyric text, wherein the lyric text comprises the tone of each lyric;
the musical note sequence generating module is used for generating a musical note sequence according to the song-composing instruction;
and the main melody generating module is used for correcting the pitch of the note sequence according to the lyric text to obtain a main melody matched with the lyric text.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202011194180.3A 2020-10-30 2020-10-30 Method and device for generating main melody, electronic equipment and storage medium Pending CN112309435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011194180.3A CN112309435A (en) 2020-10-30 2020-10-30 Method and device for generating main melody, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011194180.3A CN112309435A (en) 2020-10-30 2020-10-30 Method and device for generating main melody, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112309435A true CN112309435A (en) 2021-02-02

Family

ID=74333136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011194180.3A Pending CN112309435A (en) 2020-10-30 2020-10-30 Method and device for generating main melody, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112309435A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994022130A1 (en) * 1993-03-17 1994-09-29 Ivl Technologies Ltd. Musical entertainment system
JP2003044066A (en) * 2001-07-31 2003-02-14 Daiichikosho Co Ltd Karaoke machine with pitch shifter
US20140174279A1 (en) * 2012-12-21 2014-06-26 The Hong Kong University Of Science And Technology Composition using correlation between melody and lyrics
JP2017156495A (en) * 2016-03-01 2017-09-07 ヤマハ株式会社 Lyrics creation device and lyrics creation method
CN108109634A (en) * 2017-12-15 2018-06-01 广州酷狗计算机科技有限公司 Generation method, device and the equipment of song pitch
CN109448697A (en) * 2018-10-08 2019-03-08 平安科技(深圳)有限公司 Poem melody generation method, electronic device and computer readable storage medium
JP6587008B1 (en) * 2018-04-16 2019-10-09 カシオ計算機株式会社 Electronic musical instrument, electronic musical instrument control method, and program
WO2020015153A1 (en) * 2018-07-19 2020-01-23 平安科技(深圳)有限公司 Method and device for generating music for lyrics text, and computer-readable storage medium
WO2020077262A1 (en) * 2018-10-11 2020-04-16 WaveAI Inc. Method and system for interactive song generation

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994022130A1 (en) * 1993-03-17 1994-09-29 Ivl Technologies Ltd. Musical entertainment system
JP2003044066A (en) * 2001-07-31 2003-02-14 Daiichikosho Co Ltd Karaoke machine with pitch shifter
US20140174279A1 (en) * 2012-12-21 2014-06-26 The Hong Kong University Of Science And Technology Composition using correlation between melody and lyrics
CN103902642A (en) * 2012-12-21 2014-07-02 香港科技大学 Music composition system using correlation between melody and lyrics
JP2017156495A (en) * 2016-03-01 2017-09-07 ヤマハ株式会社 Lyrics creation device and lyrics creation method
CN108109634A (en) * 2017-12-15 2018-06-01 广州酷狗计算机科技有限公司 Generation method, device and the equipment of song pitch
JP6587008B1 (en) * 2018-04-16 2019-10-09 カシオ計算機株式会社 Electronic musical instrument, electronic musical instrument control method, and program
WO2020015153A1 (en) * 2018-07-19 2020-01-23 平安科技(深圳)有限公司 Method and device for generating music for lyrics text, and computer-readable storage medium
CN109448697A (en) * 2018-10-08 2019-03-08 平安科技(深圳)有限公司 Poem melody generation method, electronic device and computer readable storage medium
WO2020077262A1 (en) * 2018-10-11 2020-04-16 WaveAI Inc. Method and system for interactive song generation

Similar Documents

Publication Publication Date Title
CN110969012B (en) Text error correction method and device, storage medium and electronic equipment
CN111309962B (en) Method and device for extracting audio clips and electronic equipment
WO2022151966A1 (en) Processing method and apparatus for language model, text generation method and apparatus, and medium
CN112309353A (en) Composing method and device, electronic equipment and storage medium
CN111008213A (en) Method and apparatus for generating language conversion model
CN112562633A (en) Singing synthesis method and device, electronic equipment and storage medium
CN111916050A (en) Speech synthesis method, speech synthesis device, storage medium and electronic equipment
CN112380883A (en) Model training method, machine translation method, device, equipment and storage medium
CN112102801A (en) Method and device for generating main melody, electronic equipment and storage medium
CN110598049A (en) Method, apparatus, electronic device and computer readable medium for retrieving video
CN112309435A (en) Method and device for generating main melody, electronic equipment and storage medium
CN113191257B (en) Order of strokes detection method and device and electronic equipment
WO2022134968A1 (en) Model training method, speech recognition method, apparatuses, medium and device
CN113593527B (en) Method and device for generating acoustic features, training voice model and recognizing voice
CN111782895B (en) Retrieval processing method and device, readable medium and electronic equipment
CN113935418A (en) Video generation method and device
CN110209851B (en) Model training method and device, electronic equipment and storage medium
CN110688529A (en) Method and device for retrieving video and electronic equipment
CN111737572A (en) Search statement generation method and device and electronic equipment
CN115374320B (en) Text matching method and device, electronic equipment and computer medium
CN111294321B (en) Information processing method and device
CN116186093B (en) Address information processing method, address information processing device, electronic equipment and computer readable medium
CN115565607B (en) Method, device, readable medium and electronic equipment for determining protein information
CN115774539A (en) Harmony processing method, apparatus, device, and medium
CN113486982A (en) Model training method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination