CN109545177B - Melody matching method and device - Google Patents

Melody matching method and device Download PDF

Info

Publication number
CN109545177B
CN109545177B CN201910014556.9A CN201910014556A CN109545177B CN 109545177 B CN109545177 B CN 109545177B CN 201910014556 A CN201910014556 A CN 201910014556A CN 109545177 B CN109545177 B CN 109545177B
Authority
CN
China
Prior art keywords
melody
track
beat
music
score
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.)
Active
Application number
CN201910014556.9A
Other languages
Chinese (zh)
Other versions
CN109545177A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910014556.9A priority Critical patent/CN109545177B/en
Publication of CN109545177A publication Critical patent/CN109545177A/en
Application granted granted Critical
Publication of CN109545177B publication Critical patent/CN109545177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G10H7/00Instruments in which the tones are synthesised from a data store, e.g. computer organs
    • 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
    • G10H2210/00Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
    • G10H2210/101Music Composition or musical creation; Tools or processes therefor
    • G10H2210/105Composing aid, e.g. for supporting creation, edition or modification of a piece of music
    • 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
    • G10H2210/00Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
    • G10H2210/101Music Composition or musical creation; Tools or processes therefor
    • G10H2210/145Composing rules, e.g. harmonic or musical rules, for use in automatic composition; Rule generation algorithms therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The embodiment of the application discloses a melody score-matching method and a melody score-matching device, wherein the method comprises the following steps: obtaining a target melody track, determining the soundtrack duration of a first soundtrack according to the soundtrack duration of the target melody track, mapping the pitch of a reference melody note of each music beat to obtain a first pitch corresponding to each music beat based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere soundtrack content corresponding to each music beat according to the first pitch corresponding to each music beat, writing the first tension atmosphere soundtrack content corresponding to each music beat into the corresponding soundtrack of the first soundtrack based on the soundtrack duration, merging the target melody track and the first soundtrack written with the first tension atmosphere soundtrack content, obtaining a soundtrack file and outputting the soundtrack file. By adopting the embodiment of the application, melody coordination which is not limited by the level of a coordination person can be realized.

Description

Melody matching method and device
Technical Field
The application relates to the technical field of computers, in particular to a melody score method and device.
Background
Currently, when creating a music file with a tension atmosphere, a melody is usually given, and a professional musician matches the melody with chords and musical instruments to create a tension effect. However, in particular, to realize the music of a melody, the music player needs to have a strong hardware technical support in aspects of music theory, operation knowledge and the like, and meanwhile, needs to have a strong and sensitive music experience in aspects of soft technology. Because the level of the dubber is uneven, the effect of the dubber on the music matched with the given melody is good and bad, and the matched music is abrupt and unreal due to the limited level of the dubber.
Disclosure of Invention
The embodiment of the application provides a melody score method, which can realize melody score which is not limited by the level of a score player, obtain score files for creating tension atmosphere and enable music to be more harmonious and real.
In a first aspect, an embodiment of the present application provides a melody score method, including:
obtaining a target melody track, wherein the target melody track comprises a plurality of melody bars, each melody bar comprises at least one music beat, and each music beat comprises at least one melody note;
Determining the beat matching time length of a first musical score track according to the time length of the musical beats in the target melody track, wherein the number of bars and the number of beats of the first musical score track are the same as those of the target melody track;
mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain a first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere score contents corresponding to each music beat according to the first pitch corresponding to each music beat, and writing the first tension atmosphere score contents corresponding to each music beat into the corresponding score beat of the first score track based on the score beat time length of the first score track;
and combining the target melody track with the first musical score track written with the first tension musical score content to obtain and output a musical score file of the target melody track.
With reference to the first aspect, in one possible implementation manner, before merging the target melody track and the first musical score track written with the first stress musical score content to obtain a musical score file of the target melody track and output the musical score file, the method further includes: acquiring the starting and ending time periods of each melody note in the target melody track; and writing the preset tone atmosphere chord into a tone allocation time period corresponding to the start-stop time period of each melody note of the target melody track in the second tone allocation track. Combining the target melody track with the first musical score track written with the first tension musical score content to obtain and output a musical score file of the target melody track, comprising: and combining the target melody track, the first music track written with the first tone allocation content and the second music track written with the tone allocation content to obtain and output the music file of the target melody track.
With reference to the first aspect, in one possible implementation manner, acquiring the target melody track includes: acquiring an original melody file comprising a plurality of melody notes, and acquiring at least one target melody note from the original melody file, wherein the original melody file comprises a starting time and an ending time of each melody note, and the target melody note is used for representing even melody notes in the original melody file; advancing the starting time of each target melody note in the at least one target melody note by a target time threshold corresponding to each target melody note, and advancing the ending time of the previous melody note of each target melody note by the target time threshold to obtain a target melody file; a target melody track is obtained from the target melody file.
With reference to the first aspect, in one possible implementation manner, acquiring the target melody track includes: acquiring an original melody file, and detecting whether the value of a speed parameter in the original melody file is in a preset speed range; if the value of the speed parameter in the original melody file is not in the speed range, adjusting the value of the speed parameter in the original melody file to a target speed value in the speed range to obtain a target melody file; and obtaining a target melody track from the target melody file, wherein the duration of the music beat in the target melody track is a quotient obtained by dividing one minute by the target speed value.
With reference to the first aspect, in one possible implementation manner, generating first stress score content corresponding to each music beat according to a first pitch corresponding to each music beat, and writing the first stress score content corresponding to each music beat into a corresponding score beat of the first score track based on a score beat duration of the first score track includes:
obtaining the number of the rotary rhythm bars in the target melody track and dividing the number of the bars into at least 2 development stages; generating tension atmosphere score content corresponding to each music beat of each development stage according to the score rule corresponding to each development stage of the at least 2 development stages and the first pitch corresponding to each music beat of each development stage, and writing the tension atmosphere score content corresponding to each music beat into the corresponding score beat of each development stage of the first music distribution rail based on the score beat duration of the first music distribution rail.
With reference to the first aspect, in one possible implementation manner, the number of the segments is divided into 3 development stages, and specifically includes: a first development stage, a second development stage and a third development stage. Generating a tension atmosphere score content corresponding to each music beat of each development stage according to a score rule corresponding to each development stage of the at least 2 development stages and a first pitch corresponding to each music beat of each development stage, and writing the tension atmosphere score content corresponding to each music beat into a corresponding score beat of each development stage of the first music distribution rail based on a score beat time length of the first music distribution rail, wherein the tension atmosphere score content comprises:
For any music beat I in the first development stage, determining a music beat I corresponding to the music beat I on the first music distribution track according to the music beat I and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat I into the first half beat of the music beat I, and writing a pitch lower than the first pitch corresponding to the music beat I by half into the second half beat of the music beat I;
for any music beat J in the second development stage, determining a music beat J corresponding to the music beat J on the first music distribution track according to the music beat J and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat J into the first 1/3 beat of the music beat J, writing a pitch which is half tone lower than the first pitch corresponding to the music beat J between the 1/3 beat and the 2/3 beat of the music beat J, and writing a pitch which is half tone higher than the first pitch corresponding to the music beat J into the last 1/3 beat of the music beat J;
for any music beat K in the third development stage, determining a music beat K corresponding to the music beat K on the first music distribution track according to the music beat K and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat K into the first 1/4 beat of the music beat K, writing a pitch lower than the first pitch corresponding to the music beat K by one tone between the 1/4 beat and the 2/4 beat of the music beat K, writing a pitch lower than the first pitch corresponding to the music beat K by half tone between the 2/4 beat and the 3/4 beat of the music beat K, and writing a pitch higher than the first pitch corresponding to the music beat K by half tone into the last 1/4 beat of the music beat K.
With reference to the first aspect, in one possible implementation manner, writing the preset tone atmosphere chord into the soundtrack in the second soundtrack corresponding to the start-stop time period of each melody note of the target melody track includes: obtaining the number of the rotary rhythm bars in the target melody track and dividing the number of the bars into at least 2 development stages; and writing the tone of the tone atmosphere corresponding to each of the at least 2 development stages into the score period corresponding to the start-stop period of each melody note of the target melody track in the corresponding development stage of the second score track.
With reference to the first aspect, in one possible implementation manner, the number of the segments is divided into 3 development stages, and specifically includes: a first development stage, a second development stage, and a third development stage; the second score content includes a third chord, a seventh chord, or a seventh chord. Writing the tone of the tone atmosphere corresponding to each of the at least 2 development stages into the score period corresponding to the start-stop period of each melody note of the target melody track in the corresponding development stage of the second score track, including:
Acquiring a matching time period corresponding to a start-stop time period of each melody note in the first development stage, and writing a triad or a triad in each matching time period of the first development stage of the second matching musical sound track; acquiring a matching time period corresponding to a start-stop time period of each melody note in the second development stage, and writing a seventh chord or a third chord in each matching time period of the second development stage of the second matching musical sound track; and acquiring the coordination time periods corresponding to the start-stop time periods of the melody notes of the third development stage, and writing the seventh chord or the seventh chord in the coordination time periods of the third development stage of the second coordination music track.
With reference to the first aspect, in one possible implementation manner, the first development stage is T 0 To T 1 A subsection of the second development stage of T 1 To T 2 Section, the third development stage is T 2 To T 3 Nubs, T 0 =0, the T 1 Is a value obtained by rounding the product of 1/3 and the number of the bars, and the T is 2 Is a value obtained by rounding the product of 2/3 and the number of the bars, and the T is 3 A value obtained by rounding the product of the 3/3 and the number of the bars.
With reference to the first aspect, in one possible implementation manner, the target time threshold includes 1/2 (start [ n ] -start [ n-1 ]), 1/3 (start [ n ] -start [ n-1 ]), or 1/4 (start [ n ] -start [ n-1 ]), where the start [ n ] is used to represent a start time point of the nth melody note, and the start [ n-1] is used to represent a start time point of the nth-1 melody note, and n is an even number greater than or equal to 2.
In a second aspect, an embodiment of the present application provides a melody score apparatus, the apparatus including:
the first acquisition module is used for acquiring a target melody track, wherein the target melody track comprises a plurality of melody bars, each melody bar comprises a plurality of music beats, and each music beat comprises at least one melody note;
the determining module is used for determining the beat matching time length of a first musical score track according to the time length of the musical beats in the target melody track, wherein the number of bars and the number of beats of the first musical score track are the same as those of the target melody track;
the first writing module is used for mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere score contents corresponding to each music beat according to the first pitch corresponding to each music beat, and writing the first tension atmosphere score contents corresponding to each music beat into the corresponding score beats of the first music distribution track based on the score beat time length of the first music distribution track;
And the output module is used for combining the target melody track with the first musical score track written with the first tension musical score content to obtain a musical score file of the target melody track and outputting the musical score file.
In a third aspect, an embodiment of the present application provides a terminal, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, and where the memory is configured to store a computer program supporting the terminal to perform the above method, the computer program including program instructions, and the processor is configured to call the program instructions to perform the melody score method of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the melody score method of the first aspect described above.
According to the embodiment of the application, the target melody track is obtained, the beat matching time length of a first beat matching track is determined according to the time length of the beat in the target melody track, then the pitch of the reference melody notes of each music beat in the target melody track is mapped to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated musical range and the first musical range of the target melody track, the first tone matching content corresponding to each music beat is generated according to the first pitch corresponding to each music beat, the first tone matching content corresponding to each music beat is written into the corresponding beat of the first beat matching track based on the beat matching time length of the first beat matching track, and the target melody track and the first tone matching track after the first tone matching content is written are combined to obtain and output the tone file of the target melody track. The melody score not limited by the level of the score partner can be realized, and the score file for creating a tension atmosphere is obtained, so that the music is more harmonious and real.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a melody score method according to an embodiment of the present application;
FIG. 2 is another schematic flow chart of a melody score method according to an embodiment of the present application;
fig. 3a is a schematic diagram of a tone atmosphere chord corresponding to a first development phase;
fig. 3b is a schematic diagram of a tone atmosphere chord corresponding to a second development stage;
fig. 3c is a schematic illustration of a tone atmosphere chord corresponding to a third development stage;
FIG. 4a is a schematic diagram of a score rule corresponding to a first development stage;
FIG. 4b is a schematic diagram of a score rule corresponding to a second development stage;
FIG. 4c is a schematic view of a score rule corresponding to a third development stage;
fig. 5 is a schematic block diagram of a melody score apparatus according to an embodiment of the present application;
fig. 6 is a schematic block diagram of a terminal according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The melody score method and apparatus according to the embodiments of the present application will be described with reference to fig. 1 to 6.
Referring to fig. 1, a schematic flow chart of a melody score method according to an embodiment of the application is shown. As shown in fig. 1, the melody score method may include the steps of:
s101, obtaining a target melody track.
In some possible embodiments, the terminal may acquire the target melody track. Wherein the target melody track may include 16 to 24 melody bars, each melody bar may include at least one musical beat, and each musical beat may include at least one melody note. For example, the target melody track has a beat number of 4/4, which indicates that the score 4 notes are one musical beat, and each melody bar has 4 musical beats; for another example, the target melody track has a beat number of 2/4, which indicates that the score 4 is a musical beat, and each melody bar has 2 musical beats. Only one pitch and duration at a time on the target melody track. The melody in the target melody track can be any one of the commonly used 4/4 beat, 3/4 beat and 2/4 beat, and the melody in the target melody track can be any of the major C, minor C, major G or minor a, etc. The duration of the music beat in the target melody track is within a preset duration range. The preset duration may range from 0.75 seconds to 1 second, that is, the performance speed of the melody in the target melody track is between 60bpm and 80 bpm. bpm is a common term for music and is used to indicate how many beats per minute of music are.
In music, time is divided into equal basic units, and each unit is called a musical beat. The duration of a musical beat is expressed as the duration of a note, and the duration of a musical beat may be quarter note (i.e., a musical beat with quarter note) or half note (a musical beat with half note) or eighth note (a musical beat with eighth note). The duration of a musical beat is a relative time concept, such as when the performance tempo of a musical piece is 60bpm (representing 60 musical beats per minute), the time taken by each musical beat is 1 second, and half of the musical beats are 0.5 seconds; when the performance tempo is 120bpm, the time of each music beat is 0.5 seconds, half the music beats are 0.25 seconds, and so on.
In some possible embodiments, the terminal may obtain an original melody file including a plurality of melody notes, and may obtain at least one target melody note from the plurality of melody notes in the original melody file, where the target melody note may be used to represent an even number of melody notes in the original melody file, such as a 2 nd melody note, a 4 th melody note, a 6 th melody note, and a 2 m-th melody note, where m may be an integer, and where m may be a value ranging from 1 to half the number of melody notes. The original melody file may include a start time and an end time of each melody note. The terminal may advance the start time of each target melody note of the at least one target melody note by a target time threshold corresponding to each target melody note, and may advance the end time of a preceding melody note of each target melody note by the target time threshold to obtain the target melody file. The terminal may acquire the target melody track from the target melody file. According to the embodiment of the application, the time value of the melody in the original melody file (the starting time of the target melody note is advanced) is adjusted, and a random factor (the target time threshold value) is introduced into the time value of the melody, so that the unstable feeling of the music can be increased, and the unstable feeling of the melody in the target melody track can be increased.
The original melody file may be a single-tone melody file in a musical instrument digital interface (musical instrument digital interface, MIDI) format, which may represent a melody file having only one pitch and duration at the same time. The target time threshold may include 1/2 (start [ n ] -start [ n-1 ]), 1/3 (start [ n ] -start [ n-1 ]), or 1/4 (start [ n ] -start [ n-1 ]), which may be used to represent a start time point of the nth melody note, and the start [ n-1] may be used to represent a start time point of the nth-1 melody note, and n may be an even number greater than or equal to 2.
For example, take the 2 nd and 4 th melody notes in the original melody file as examples. The terminal advances the start time of the 2 nd melody note (target melody note) in the original melody file by any one value of 1/2 (start [ n ] -start [ n-1 ]), 1/3 (start [ n ] -start [ n-1 ]), or 1/4 (start [ n ] -start [ n-1 ]), such as 1/3 (start [ n ] -start [ n-1 ]), advances the end time of the previous melody note (i.e., 1 st melody note) of the 2 nd melody note by 1/3 (start [2] -start [1 ]), wherein start [2] represents the start time of the 2 nd melody note, and start [1] represents the start time of the 1 st melody note. The terminal advances the start time of the 4 th melody note (target melody note) in the original melody file by any one value of 1/2 (start [ n ] -start [ n-1 ]), 1/3 (start [ n ] -start [ n-1 ]), or 1/4 (start [ n ] -start [ n-1 ]), such as 1/2 (start [4] -start [3 ]), advances the end time of the previous melody note (i.e., 3 rd melody note) of the 4 th melody note by 1/2 (start [4] -start [3 ]), wherein start [4] represents the start time of the 4 th melody note, and start [3] represents the start time of the 3 rd melody note.
In some possible embodiments, the terminal may acquire an original melody file, and may acquire a speed parameter (i.e., performance speed) of the melody from the original melody file. The terminal may detect whether the value of the speed parameter is within a preset speed range. If the value of the speed parameter of the melody in the original melody file is not in the preset speed range, the value of the speed parameter can be adjusted to be a target speed value in the speed range, so that a target melody file is obtained. The terminal may acquire the target melody track from the target melody file. Since the time in music is divided into equal basic units, the duration of the beat of the music in the target melody file is 60 seconds (i.e., one minute) divided by the quotient of the target tempo value. For example, if the target tempo value is 70bpm, the duration of the music beat in the target melody file is 60/70=6/7 seconds. The predetermined speed range may be between 60bpm and 80 bpm.
In some possible embodiments, the terminal may acquire an original melody file and may acquire the speed parameter of the melody from the original melody file. The terminal may detect whether the value of the speed parameter is within a preset speed range. If the value of the speed parameter of the melody in the original melody file is not within the preset speed range, the value of the speed parameter can be adjusted to be a target speed value within the speed range. The terminal may acquire at least one target melody note from among a plurality of melody notes of the original melody file, the target melody note being used to represent even melody notes in the original melody file, and the original melody file may include a start time and an end time of each melody note. The terminal may advance the start time of each target melody note of the at least one target melody note by a target time threshold corresponding to each target melody note, and may advance the end time of a preceding melody note of each target melody note by the target time threshold to obtain the target melody file. The terminal may acquire the target melody track from the target melody file.
S102, determining the music beat duration of the first music track according to the duration of the music beats in the target melody track.
In some possible embodiments, the terminal may obtain the duration of the music beat in the target melody track, and may use the duration of the music beat in the target melody track as the duration of the music beat of the first music track, and may indicate that the speed parameter of the target melody track is the same as the speed parameter of the first music track. For example, the duration of the music beat in the target melody track is 6/7 seconds, and then the duration of the music beat of the first music track is 6/7 seconds. The first musical score track may be a cello track, and the cello track is the same as the target melody track in number of bars and number of beats.
S103, mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere score contents corresponding to each music beat according to the first pitch corresponding to each music beat, and writing the first tension atmosphere score contents corresponding to each music beat into the corresponding score beats of the first score track based on the score beat time length of the first score track.
In some possible embodiments, the terminal may obtain the reference melody notes for each musical beat in the target melody track. The reference melody note may be the first melody note in each musical beat or the first melody note in a musical beat preceding the musical beat. If the first melody note of a certain music beat is a rest, determining the first melody note of the previous music beat of the music beat as a reference melody note of the music beat; if the first melody note of the music beat is not a rest, the first melody note of the music beat is determined as a reference melody note of the music beat. The terminal may obtain a mapping relationship between the gamut of the target melody track and the first gamut of the first musical score, and may map, according to the mapping relationship, pitches of the reference melody notes of each music beat in the target melody track, to obtain first pitches corresponding to each music beat in the target melody track. The terminal may generate first score content corresponding to the respective music tempo according to the first pitch corresponding to the respective music tempo, and the first score content may include pitches near the first pitch corresponding to the respective music tempo, e.g., pitches one tone and/or half tones lower than the first pitch corresponding to the respective music tempo. The terminal may determine, on the first musical score track, a musical score corresponding to each of the musical scores based on the musical score duration of the first musical score track, and may write the first stress musical score content corresponding to each of the musical scores into the corresponding musical score of the first musical score track. The gamut to which the target melody track belongs may be between the small word group G and the small word group G, the first gamut may be a gamut to which a cello track (the first musical note matching track) belongs, and the gamut to which the cello track belongs may be between one octave of the small word group #c and the small word group C.
For example, the terminal detects which pitch in c#cd#def#fg#ga#ab, i.e., cm_pitch [ n ], the first pitch corresponding to each music tempo is. Cm_pitch [ n ] represents the first pitch corresponding to the nth music beat in the target melody track. Assuming cm_pitch [3] is E, the first stress score corresponding to the 3 rd music tempo may be at least 2 pitches in D, # D, E, F. Assuming that the length of the dubbing beat of the cello track is 6/7 seconds, 0 to 6/7 seconds represents the 1 st dubbing beat, 6/7 seconds to 12/7 seconds represents the 2 nd dubbing beat, and so on. The terminal determines the 3 rd beat of the music corresponding to the 3 rd beat of the music, i.e., between 12/7 seconds and 18/7 seconds, on the cello track based on the beat duration of the cello track. The terminal writes the first strenuous music content (e.g., # D and E) corresponding to the 3 rd music tempo of the violin track, i.e., between 12/7 seconds and 18/7 seconds of the violin track.
S104, combining the target melody track and the first musical score track written with the first tension musical score content to obtain and output a musical score file of the target melody track.
In some possible embodiments, the terminal may combine the target melody track with the first musical score track (violin track) written with the first stressful musical score content according to the evolution relationship of time, to obtain a musical score file, and output the musical score file in MIDI format. The score file may include the main melody in the target melody track. For example, at time t, the target melody track and the cello track simultaneously emit sounds each at time t. According to the embodiment of the application, the music content of the tension atmosphere is written in the violin sound track to generate the accelerated listening feeling, and the violin sound track and the target melody sound track are combined and output, so that the tension feeling of music can be increased, melody music which is not limited by the level of a music distributor is realized, a music file for creating the tension atmosphere is obtained, and meanwhile, the music is more harmonious and real.
In the embodiment of the application, a terminal determines the soundtrack duration of a first soundtrack according to the soundtrack duration of a target melody in the target melody track, maps the pitch of a reference melody note of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generates first tone content of a tone in tension corresponding to each music beat according to the first pitch corresponding to each music beat, writes the first tone content of a tone in tension corresponding to each music beat in the corresponding soundtrack of the first soundtrack based on the soundtrack duration of the first soundtrack, combines the target melody track with the first soundtrack written in the first tone content of the first soundtrack, and obtains and outputs the soundfile of the target melody track. The melody score not limited by the level of the score partner can be realized, and the score file for creating a tension atmosphere is obtained, so that the music is more harmonious and real.
Referring to fig. 2, another schematic flowchart of the melody score method according to the embodiment of the application is shown. As shown in fig. 2, the melody score method may include the steps of:
S201, obtaining a target melody track.
In some possible implementations, step S201 in the embodiment of the present application may refer to the implementation manner of step S101 in the embodiment shown in fig. 1, which is not described herein.
S202, acquiring the number of the measure of the rotation rhythm in the target melody track, and dividing the number of the measure into at least 2 development stages.
In some possible embodiments, the target melody track may include 16 to 24 melody bars, each of which may include at least one musical tempo, and each of which may include at least one melody note. The terminal may acquire the number of measure of the whirl in the target melody track and may divide the number of measure into at least 2 development stages. The at least 2 development stages can be equally divided or divided proportionally. For example, if the number of bars is 18, the number of bars is divided into 3 development stages uniformly, the first development stage is 0 to 6 bars, the second development stage is 7 to 12 bars, and the third development stage is 13 to 18 bars; if the number of bars is divided into 3 development stages in proportion (e.g., 1:2:3), the first development stage is 0 to 3 bars, the second development stage is 4 to 9 bars, and the third development stage is 10 to 18 bars.
In some possible implementations, the embodiment of the present application may execute steps S203-S204 and steps S205-S207 in parallel after step S202; the steps S203-S204 and S205-S207 may be performed first, or the steps S205-S207 may be performed first and the steps S203-S204 may be performed second, which is not limited in the embodiment of the present application.
S203, the beginning and ending time periods of each melody note in the target melody track are acquired.
And S204, writing the tone atmosphere chord corresponding to each development stage of the at least 2 development stages into the matching time period corresponding to the start-stop time period of each melody note of the target melody track in the corresponding development stage of the second matching musical track.
In some possible embodiments, the terminal may obtain the start-stop time period of each melody note in the target melody track, and may obtain the score time period corresponding to the start-stop time period of each melody note. The terminal may create a second score track, which may be a piano track, which is identical to the speed parameter, the bar number, and the beat number of the target melody track described above. The terminal may acquire a preset tone atmosphere chord, and may write the tone atmosphere chord into a score period corresponding to a start-stop period of each melody note in the piano track. The tone atmosphere chord may include, among others, a chord commonly used for creating tone atmosphere, a tri-chord, an up-chord, a down-chord, or an up-chord. The start-stop period of the melody note is used to represent a period between the start time and the end time of the melody note. According to the embodiment of the application, the tension sense of music is increased by writing the tension atmosphere chord on the piano track, so that the tension effect is created.
In some possible embodiments, the terminal may obtain the start-stop time period of each melody note in the target melody track, and may obtain the score time period corresponding to the start-stop time period of each melody note. The terminal may create a second score track, which may be a piano track, which is identical to the above-mentioned target melody track in terms of the number of bars and beats. The terminal can acquire preset tension atmosphere chords, and can write the tension atmosphere chords corresponding to each of the at least 2 development stages into the music distribution time periods of the corresponding development stages of the piano tracks.
For example, assuming that the tone of the tone corresponding to the first development stage of at least 2 development stages is a minus or an plus chord, the tone of the tone corresponding to the second development stage of at least 2 development stages is a minus or a plus chord, and the tone of the tone corresponding to the third development stage of at least 2 development stages is a minus or a plus chord. The terminal writes the minus chord or the plus chord into each of the soundtrack periods of the first development stage of the piano track, writes the minus chord or the plus chord into each of the soundtrack periods of the second development stage of the piano track, and writes the minus chord or the plus chord into each of the soundtrack periods of the third development stage of the piano track.
In some possible embodiments, the number of the segments may be divided into 3 development stages, including: a first development stage, a second development stage and a third development stage. The terminal may acquire the start-stop time periods of the respective melody notes in the target melody track, and may acquire the score time periods corresponding to the start-stop time periods of the respective melody notes. The terminal may create a second score track, which may be a piano track, which is identical to the above-mentioned target melody track in terms of the number of bars and beats. For each of the score periods of the first development stage in the piano track, the terminal can selectively write the minus chord or the plus chord in the each score period. For each of the soundtrack periods of the second development stage in the piano track, the terminal can selectively write the seventh chord or the third chord in the respective soundtrack period. For each of the soundtrack periods of the third development stage in the piano track, the terminal can selectively write the seventh chord or the seventh chord in the respective soundtrack period. Wherein the first development stage is T 0 To T 1 Section, the second development stage is T 1 To T 2 Section, third stage of development is T 2 To T 3 The subsections. T (T) 0 =0,T 1 A value rounded 1/3 times the product of the number of bars, T 1 =[1/3*barmax];T 2 A value rounded by the product of 2/3 and the number of the bars, i.e. T 2 =[2/3*barmax];T 3 A value rounded by the product of 3/3 and the number of the bars, i.e. T 3 =[3/3*barmax]The method comprises the steps of carrying out a first treatment on the surface of the barmax represents the number of bars of the melody bars, [ x ]]Representing the integer part of x.
For example, as shown in fig. 3a, a schematic diagram of a tone atmosphere chord corresponding to the first development phase is shown. Wherein pitch [ n ] is used to represent the pitch of the nth melody note, n being an integer greater than or equal to 1. pitch n + x is used to represent the pitch number of the nth melody note in the MIDI protocol plus the corresponding value x, there will be notes of the corresponding pitch. A 1 in fig. 3a indicates that there is a note corresponding to the pitch, and a 0 indicates that there is no note corresponding to the pitch. The terminal randomly selects and writes at least one tone pitch corresponding to the minus chord or the plus chord in the score period corresponding to the start-stop period of each melody note in the first development stage, namely, the tone pitch with the number of 1 in the selected chord is completely written in the score period. Assuming that the start-stop period of the 1 st melody note is 0 to 0.2s, the score period corresponding to the start-stop period of the 1 st melody note is also 0 to 0.2s (seconds). The chord selected by the terminal in the score period 0-0.2s is the minus chord, and the pitches (pitch [1], pitch [1] +3, and pitch [1] +6) numbered 1 among the minus chords are all written in the piano track 0-0.2 s. The start-stop period of the 2 nd melody note is 0.2s to 0.3s, and then the score period corresponding to the start-stop period of the 2 nd melody note is also 0.2s to 0.3s. The chords selected by the terminal in the score period of 0.2s-0.3s are the tri-chords, and the pitches (pitch [2], pitch [2] +4 ] and pitch [2] +8) numbered 1 among the tri-chords are all written in the range of 0.2-0.3s of the piano track. As shown in fig. 3b, is a schematic representation of a corresponding stress chord in the second development stage. As shown in fig. 3c, a schematic representation of a tone atmosphere chord corresponding to the third development stage is shown. Similarly, the terminal randomly selects and writes at least one pitch corresponding to the seventh chord or the seventh chord in each of the soundtrack periods of the second development stage of the piano track, and randomly selects and writes at least one pitch corresponding to the seventh chord or the seventh chord in each of the soundtrack periods of the third development stage. At this time, the embodiment of the present application increases the sense of incongruity of the piano track by writing a plurality of different pitches, which are simultaneously sounded, in each of the dubbing periods of the first development stage, the second development stage and the third development stage of the piano track.
S205, determining the length of the musical beat of the first musical score track according to the length of the musical beat in the target melody track.
In some possible implementations, step S205 in the embodiment of the present application may refer to the implementation manner of step S102 in the embodiment shown in fig. 1, which is not described herein.
S206, mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track.
S207, generating tone content of tension atmosphere corresponding to each music beat of each development stage according to the tone allocation rule corresponding to each development stage of at least 2 development stages and the first pitch corresponding to each music beat of each development stage, and writing the tone content of tension atmosphere corresponding to each music beat into the corresponding tone beat of each development stage of the first tone allocation rail based on the tone allocation beat time length of the first tone allocation rail.
In some possible embodiments, the terminal may obtain the reference melody notes of each music beat in the target melody track. The reference melody note may be the first melody note in each musical beat or the first melody note in a musical beat preceding the musical beat. If the first melody note of a certain music beat is a rest, determining the first melody note of the previous music beat of the music beat as a reference melody note of the music beat; if the first melody note of the music beat is not a rest, the first melody note of the music beat is determined as a reference melody note of the music beat. The terminal may obtain a mapping relationship between the gamut of the target melody track and the first gamut of the first musical score, and may map, according to the mapping relationship, pitches of the reference melody notes of each music beat in the target melody track, to obtain first pitches corresponding to each music beat in the target melody track. The terminal may obtain the score rules corresponding to each of the at least 2 development stages, and may generate the stress score content corresponding to each of the music beats in each of the development stages according to the score rules corresponding to each of the development stages and the first pitches corresponding to each of the music beats in each of the development stages. The terminal may determine, on the basis of the duration of the musical beats of the first musical score rail, musical beats corresponding to the respective musical beats in the respective development stages, and may write the stressful atmosphere musical beat content corresponding to the respective musical beats in the first musical score rail. The gamut to which the target melody track belongs may be between the small word group G and the small word group G, the first gamut may be a gamut to which a cello track (the first musical note matching track) belongs, and the gamut to which the cello track belongs may be between one octave of the small word group #c and the small word group C. The score rules corresponding to the respective development stages may be preset.
For example, as shown in fig. 4a, a schematic diagram of a score rule corresponding to the first development stage is shown. The pitch of the first half of each music beat in the first development stage is consistent with the first pitch corresponding to the music beat, and the pitch of the second half of the music beat in the first development stage is lower than the first pitch corresponding to the music beat by half of a sound. Assuming that the first pitch corresponding to any music beat i in the first development stage is #d in c#cd#def#fg#ga#ab, the stress atmosphere score content corresponding to the music beat i is #d and D according to the score rule corresponding to the first development stage and the first pitch corresponding to the music beat i. As shown in fig. 4b, a schematic diagram of the score rule corresponding to the second development stage is shown. The first 1/3 of the musical beats of each musical beat in the second development stage have a pitch consistent with the first pitch corresponding to the musical beat, 1/3 of the musical beats (i.e., between 1/3 of the musical beats and 2/3 of the musical beats) have a pitch half tone lower than the first pitch corresponding to the musical beat, and the last 1/3 of the musical beats have a pitch half tone higher than the first pitch corresponding to the musical beat. Assuming that the first pitch corresponding to any one of the music beats j in the second development stage is a in c#cd#def#fg#ga#ab, the stress music content corresponding to the music beat j is generated as a, #g, and #a according to the music rule corresponding to the second development stage and the first pitch corresponding to the music beat j. Fig. 4c is a schematic diagram of the score rule corresponding to the third development stage. The pitch of the first 1/4 of each music beat in the third development stage is consistent with the first pitch corresponding to the music beat, the pitch of the first 1/4 music beat (i.e. between 1/4 music beat and 2/4 music beat) is lower than the first pitch corresponding to the music beat by one tone, the pitch of the last 1/4 music beat (i.e. between 2/4 music beat and 3/4 music beat) is lower than the first pitch corresponding to the music beat by half tone, and the pitch of the last 1/4 music beat is higher than the first pitch corresponding to the music beat by half tone. Assuming that the first pitch corresponding to any one of the music beats k in the third development stage is D in c#cd#def#fg#ga#ab, the tone contents of the stressful atmosphere corresponding to the music beat k are D, C, #c, and #d according to the tone rule corresponding to the third development stage and the first pitch corresponding to the music beat k. Cm_pitch [ n ] in fig. 4a, 4b, and 4c is used to represent a first pitch corresponding to the nth music beat, cm_pitch [ n ] -1 is used to represent a pitch lower than the first pitch cm_pitch [ n ] by half a tone, cm_pitch [ n ] +1 is used to represent a pitch higher than the first pitch cm_pitch [ n ] by half a tone, and cm_pitch [ n ] -2 is used to represent a pitch lower than the first pitch cm_pitch [ n ]. A 1 indicates that this pitch is used and a 0 indicates that this pitch is not used.
In some possible embodiments, the number of the segments may be divided into 3 development stages, including: a first development stage, a second development stage and a third development stage. After obtaining the first pitch corresponding to each music beat in the target melody track, the terminal takes the music beat I in the first development stage as an example for each music beat in the first development stage, and determines the music beat I corresponding to the music beat I on the cello track according to the music beat I and the music beat duration of the cello track (the first music track). The terminal may write the first pitch corresponding to the music beat I into the first half beat of the score beat I, and write the pitch lower than the first pitch corresponding to the music beat I by half into the second half beat of the score beat I. For each music beat in the second development stage, taking the music beat J in the second development stage as an example, the terminal may determine a corresponding music beat J of the music beat J on the cello track according to the music beat J and the music beat duration of the cello track. The terminal may write the first pitch corresponding to the music beat J into the first 1/3 beat of the score beat J, write the pitch lower than the first pitch corresponding to the music beat J by half a tone between the 1/3 beat and the 2/3 beat of the score beat J, and write the pitch higher than the first pitch corresponding to the music beat J by half a tone into the last 1/3 beat of the score beat J. For each music beat in the third development stage, taking the music beat K in the third development stage as an example, the terminal may determine a corresponding music beat K of the music beat K on the cello track according to the music beat K and the music beat duration of the cello track. The terminal may write the first pitch corresponding to the music beat K into the first 1/4 beat of the score beat K, write the pitch one tone lower than the first pitch corresponding to the music beat K between the 1/4 beat and the 2/4 beat of the score beat K, write the pitch one half tone lower than the first pitch corresponding to the music beat K between the 2/4 beat and the 3/4 beat of the score beat K, and write the pitch one half tone higher than the first pitch corresponding to the music beat K into the last 1/4 beat of the score beat K. The starting and ending time of the violin notes on the violin track is independent of the starting and ending time of the melody notes on the target melody track, and the duration of a time value (used for expressing the relative duration between the notes in the music score) is changed in different development stages, so that an accelerated listening feel is generated, and the tension feel on music is increased.
Wherein, the length of the music beat in the target melody track is the same as the length of the music beat of the cello track, and the number of the small sections of the target melody track is the same as that of the cello trackThe same as the measure of the track, so that the m-th music tempo on the target melody track corresponds to the m-th score tempo of the cello track, m may be an integer greater than or equal to 1. The first development stage is T 0 To T 1 Section, the second development stage is T 1 To T 2 Section, third stage of development is T 2 To T 3 The subsections. T (T) 0 =0,T 1 A value rounded 1/3 times the product of the number of bars, T 1 =[1/3*barmax];T 2 A value rounded by the product of 2/3 and the number of the bars, i.e. T 2 =[2/3*barmax];T 3 A value rounded by the product of 3/3 and the number of the bars, i.e. T 3 =[3/3*barmax]The method comprises the steps of carrying out a first treatment on the surface of the barmax represents the number of bars of the melody bars, [ x ]]Representing the integer part of x.
For example, assuming that the measure number barman=18 for melody measures, the first development phase is 0-6 measures, the second development phase is 7-12 measures, and the third development phase is 13-18 measures. Assuming that the target melody track has a beat number of 2/4 (representing that the score 4 is one musical beat, and 2 musical beats are provided per bar), the first development stage is 0-12 beats, the second development stage is 13-24 beats, and the third development stage is 25-36 beats. Assume that the duration of the dubbing beat of the cello track is 6/7s (the same as the duration of the music beat in the target melody track). The terminal acquires which pitch of c#cd#def#fg#ga#ab corresponds to the first pitch of each music tempo. Assuming that the first pitch corresponding to the 3 rd music beat is F, the terminal determines the 3 rd music beat (between 12/7s-18/7 s) corresponding to the 3 rd music beat on the cello track according to the 3 rd music beat and the length of the music beat of the cello track of 6/7 s. The terminal writes the first pitch F into the first half beat (between 12/7s-15/7 s) of the 3 rd musical tempo, and writes the pitch E of the half tone lower than the first pitch F into the second half beat (between 15/7s-18/7 s) of the 3 rd musical tempo. Similarly, assuming that the first pitch corresponding to the 13 th music beat is A, the terminal determines the 13 th music beat (72/7 s-78/7 s) corresponding to the 13 th music beat on the cello track according to the 13 th music beat and the length of the music beat of the cello track of 6/7 s. The terminal writes the first pitch A into the first 1/3 beat of 13 th music beat (between 72/7s-74/7 s), writes the pitch #G of half tone lower than the first pitch A into the 1/3 beat to 2/3 beat of 13 th music beat (between 74/7s-76/7 s), and writes the pitch #A of half tone higher than the first pitch A into the last 1/3 beat (between 76/7s-78/7 s) of 13 th music beat. Assuming that the first pitch corresponding to the 30 th music beat is #G, the terminal determines the 30 th music beat (174/7 s-180/7 s) corresponding to the 30 th music beat on the cello track according to the 30 th music beat and the length of the music beat of the cello track of 6/7 s. The terminal writes the first pitch #G into the first 1/4 beat of the 30 th music beat (between 174/7s-175.5/7 s), writes the pitch #F lower than the first pitch #G by one tone into the first 1/4 beat to the second 1/4 beat of the 30 th music beat (between 175.5/7s-177/7 s), writes the pitch G lower than the first pitch #G by half tone into the second 1/4 beat to the third 1/4 beat of the 30 th music beat (between 177/7s-178.5/7 s), and writes the pitch A higher than the first pitch #G by half tone into the second 1/4 beat (between 178.5/7s-180/7 s) of the 30 th music beat.
And S208, merging the target melody track, the first musical score track written with the first tone allocation content and the second musical score track written with the tone allocation chord to obtain and output the musical score file of the target melody track.
In some possible embodiments, the terminal may combine the target melody track, the first musical score track (violin track) written with the first stress musical score content, and the second musical score track (piano track) written with the stress chord according to a time evolution relationship to obtain a musical score file, and output the musical score file in MIDI format. The score file may include the main melody in the target melody track. For example, at time t, the target melody track, the cello track, and the piano track simultaneously emit the sounds each at time t. According to the embodiment of the application, the chord with the tension is written in the piano track, different music contents with the tension are written in different development stages of the cello track, so that the accelerated listening feeling is generated, and the piano track, the cello track and the target melody track are combined and output, so that the tension feeling of music can be further increased, the melody music which is not limited by the level of a player is realized, the music file with the tension is obtained, and meanwhile, the music is more harmonious and real.
In the embodiment of the application, the terminal acquires the target melody track, acquires the number of the measure of the rotation in the target melody track, and divides the number of the measure into at least 2 development stages. In one aspect, the terminal obtains the start-stop time periods of the melody notes in the target melody track, and writes the tone atmosphere chord corresponding to each of the at least 2 development stages into the score time period corresponding to the start-stop time period of each melody note in the target melody track in the corresponding development stage of the second score track. On the other hand, the terminal determines the duration of the soundtrack of the first soundtrack according to the duration of the musical beats in the target melody track, and maps the pitch of the reference melody notes of each musical beat to obtain the first pitch corresponding to each musical beat based on the mapping relation between the affiliated gamut of the target melody track and the first gamut. Generating tension atmosphere score content corresponding to each music beat according to the score rule corresponding to each development stage in the at least 2 development stages and the first pitch corresponding to each music beat in each development stage, and writing the tension atmosphere score content corresponding to each music beat into the corresponding score beat of the first score track based on the score beat duration of the first score track. And finally, the terminal combines the target melody track, the first musical score track written with the first tone allocation content and the second musical score track written with the tone allocation chord to obtain the musical score file of the target melody track. The melody score not limited by the level of the score partner can be realized, and the score file for creating a tension atmosphere is obtained, so that the music is more harmonious and real.
Referring to fig. 5, a schematic block diagram of a melody score apparatus according to an embodiment of the application is shown. As shown in fig. 5, the melody score apparatus according to the embodiment of the present application includes:
a first obtaining module 10, configured to obtain a target melody track, where the target melody track includes a plurality of melody bars, each melody bar includes a plurality of musical beats, and each musical beat includes at least one melody note;
a determining module 20, configured to determine a duration of a beat of a first musical score according to a duration of a beat of a musical score in the target melody track, where the number of bars and the number of beats of the first musical score are the same as those of the target melody track;
the first writing module 30 is configured to map pitches of reference melody notes of each music beat in the target melody track to obtain first pitches corresponding to each music beat in the target melody track based on a mapping relationship between a domain to which the target melody track belongs and the first domain, generate first tension music content corresponding to each music beat according to the first pitches corresponding to each music beat, and write the first tension music content corresponding to each music beat into a corresponding music beat of the first music distribution track based on a music beat duration of the first music distribution track;
The output module 40 is configured to combine the target melody track with the first musical score track written with the first ambiance musical score content to obtain a musical score file of the target melody track and output the musical score file.
In some possible embodiments, the apparatus further comprises a second acquisition module 50 and a second writing module 60. The second obtaining module 50 is configured to obtain a start-stop time period of each melody note in the target melody track; the second writing module 60 is configured to write the preset tone atmosphere chord into the musical score period corresponding to the start-stop period of each melody note of the target melody track in the second musical score track. The output module 40 is specifically configured to combine the target melody track, the first music track written with the first tone allocation content, and the second music track written with the tone allocation content, obtain a music file of the target melody track, and output the music file.
In some possible embodiments, the first obtaining module 10 is specifically configured to: acquiring an original melody file comprising a plurality of melody notes, and acquiring at least one target melody note from the original melody file, wherein the original melody file comprises a starting time and an ending time of each melody note, and the target melody note is used for representing even melody notes in the original melody file; advancing the starting time of each target melody note in the at least one target melody note by a target time threshold corresponding to each target melody note, and advancing the ending time of the previous melody note of each target melody note by the target time threshold to obtain a target melody file; a target melody track is obtained from the target melody file.
In some possible embodiments, the first obtaining module 10 is specifically configured to: acquiring an original melody file, and detecting whether the value of a speed parameter in the original melody file is in a preset speed range; if the value of the speed parameter in the original melody file is not in the speed range, adjusting the value of the speed parameter in the original melody file to a target speed value in the speed range to obtain a target melody file; and obtaining a target melody track from the target melody file, wherein the duration of the music beat in the target melody track is a quotient obtained by dividing one minute by the target speed value.
In some possible embodiments, the first writing module 30 includes a mapping unit 301 and a first writing unit 302. The mapping unit 301 is configured to map, based on a mapping relationship between the domain to which the target melody track belongs and the first domain, pitches of the reference melody notes of each music beat in the target melody track to obtain a first pitch corresponding to each music beat in the target melody track. The first writing unit 302 is configured to generate first stress score content corresponding to each music beat according to a first pitch corresponding to each music beat, and write the first stress score content corresponding to each music beat into a corresponding score beat of the first score track based on a score beat duration of the first score track.
The first writing unit 302 is specifically configured to: obtaining the number of the rotary rhythm bars in the target melody track and dividing the number of the bars into at least 2 development stages; generating tension atmosphere score content corresponding to each music beat of each development stage according to the score rule corresponding to each development stage of the at least 2 development stages and the first pitch corresponding to each music beat of each development stage, and writing the tension atmosphere score content corresponding to each music beat into the corresponding score beat of each development stage of the first music distribution rail based on the score beat duration of the first music distribution rail.
In some possible embodiments, the number of segments is divided into 3 stages of development, including: a first development stage, a second development stage and a third development stage. The first writing unit 302 is specifically further configured to:
for any music beat I in the first development stage, determining a music beat I corresponding to the music beat I on the first music distribution track according to the music beat I and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat I into the first half beat of the music beat I, and writing a pitch lower than the first pitch corresponding to the music beat I by half into the second half beat of the music beat I;
For any music beat J in the second development stage, determining a music beat J corresponding to the music beat J on the first music distribution track according to the music beat J and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat J into the first 1/3 beat of the music beat J, writing a pitch which is half tone lower than the first pitch corresponding to the music beat J between the 1/3 beat and the 2/3 beat of the music beat J, and writing a pitch which is half tone higher than the first pitch corresponding to the music beat J into the last 1/3 beat of the music beat J;
for any music beat K in the third development stage, determining a music beat K corresponding to the music beat K on the first music distribution track according to the music beat K and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat K into the first 1/4 beat of the music beat K, writing a pitch lower than the first pitch corresponding to the music beat K by one tone between the 1/4 beat and the 2/4 beat of the music beat K, writing a pitch lower than the first pitch corresponding to the music beat K by half tone between the 2/4 beat and the 3/4 beat of the music beat K, and writing a pitch higher than the first pitch corresponding to the music beat K by half tone into the last 1/4 beat of the music beat K.
In some possible embodiments, the second writing module 60 includes an obtaining unit 601 and a second writing unit 602. The obtaining unit 601 is configured to obtain a measure of a rotation in the target melody track, and divide the measure into at least 2 development stages; the second writing unit 602 is configured to write the tone atmosphere and chord corresponding to each of the at least 2 development stages into the score period corresponding to the start-stop period of each melody note of the target melody track in the corresponding development stage of the second score track.
In some possible embodiments, the number of segments is divided into 3 stages of development, including: a first development stage, a second development stage, and a third development stage; the second score content includes a third chord, a seventh chord, or a seventh chord. The second writing unit 602 is specifically configured to:
acquiring a matching time period corresponding to a start-stop time period of each melody note in the first development stage, and writing a triad or a triad in each matching time period of the first development stage of the second matching musical sound track;
acquiring a matching time period corresponding to a start-stop time period of each melody note in the second development stage, and writing a seventh chord or a third chord in each matching time period of the second development stage of the second matching musical sound track;
And acquiring the coordination time periods corresponding to the start-stop time periods of the melody notes of the third development stage, and writing the seventh chord or the seventh chord in the coordination time periods of the third development stage of the second coordination music track.
In some possible embodiments, the first development stage is T 0 To T 1 A subsection of the second development stage of T 1 To T 2 Section, the third development stage is T 2 To T 3 Nubs, T 0 =0, the T 1 Is a value obtained by rounding the product of 1/3 and the number of the bars, and the T is 2 Rounding the product of 2/3 and the number of barsPost value, T 3 A value obtained by rounding the product of the 3/3 and the number of the bars.
In some possible embodiments, the target time threshold includes 1/2 (start [ n ] -start [ n-1 ]), 1/3 (start [ n ] -start [ n-1 ]), or 1/4 (start [ n ] -start [ n-1 ]), the start [ n ] being used to represent a start time point of the nth melody note, the start [ n-1] being used to represent a start time point of the nth-1 melody note, the n being an even number greater than or equal to 2.
In a specific implementation, the melody score apparatus may implement the functions implemented in the above embodiments by executing the implementation manners provided by the steps in the implementation manners provided in fig. 1 or fig. 2 by using the above modules, and specifically, reference may be made to corresponding descriptions provided by the steps in the method embodiment shown in fig. 1 or fig. 2, which are not repeated herein.
In the embodiment of the application, the melody score device determines the score duration of a first score track according to the duration of a music beat in the target melody track by acquiring the target melody track, maps the pitch of a reference melody note of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated musical range and the first musical range of the target melody track, generates first tension score content corresponding to each music beat according to the first pitch corresponding to each music beat, writes the first tension score content corresponding to each music beat into the corresponding score track of the first score track based on the score duration of the first score track, combines the target melody track and the first score track written in the first tension score content, and obtains and outputs the score file of the target melody track. The melody score not limited by the level of the score partner can be realized, and the score file for creating a tension atmosphere is obtained, so that the music is more harmonious and real.
Referring to fig. 6, a schematic block diagram of a terminal according to an embodiment of the present application is provided. As shown in fig. 6, the terminal in the embodiment of the present application may include: one or more processors 6001; one or more input devices 6002, one or more output devices 6003 and a memory 6004. The processor 6001, the input device 6002, the output device 6003, and the memory 6004 are connected by a bus 6005. The memory 6002 is for storing a computer program comprising program instructions, and the processor 6001 is for executing the program instructions stored by the memory 6002.
Wherein the input device 6002 is configured to obtain a target melody track. The processor 6001 is configured to invoke the program instruction execution: determining the music beat duration of the first music track according to the duration of the music beats in the target melody track; mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere score content corresponding to each music beat according to the first pitch corresponding to each music beat, and writing the first tension atmosphere score content corresponding to each music beat into the corresponding score beat of the first score track based on the score beat time length of the first score track. The output device 6003 is configured to combine the target melody track with the first musical score track written with the first ambiance musical score content to obtain a musical score file of the target melody track and output the musical score file.
It should be appreciated that in embodiments of the application, the processor 6001 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 6002 may include a touch pad, microphone, etc., and the output device 6003 may include a display (LCD, etc.), speaker, etc.
The memory 6004 may include read only memory and random access memory, and provides instructions and data to the processor 6001. A portion of the memory 6004 may also include nonvolatile random access memory. For example, the memory 6004 may also store information of a device type.
In a specific implementation, the processor 6001, the input device 6002 and the output device 6003 described in the embodiments of the present application may execute the implementation described in the melody score method provided in the embodiments of the present application, and may also execute the implementation of the melody score device described in the embodiments of the present application, which is not described herein again.
The embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program includes program instructions, which when executed by a processor, implement the melody score method shown in fig. 1 or fig. 2, and the specific details are described with reference to the embodiment shown in fig. 1 or fig. 2, and are not repeated herein.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (9)

1. A melody score method, comprising:
acquiring an original melody file comprising a plurality of melody notes, and acquiring at least one target melody note from the original melody file, wherein the original melody file comprises a starting time and an ending time of each melody note, and the target melody note is used for representing even melody notes in the original melody file;
advancing the starting time of each target melody note in the at least one target melody note by a target time threshold corresponding to each target melody note, and advancing the ending time of a preceding melody note of each target melody note by the target time threshold to obtain a target melody file;
obtaining a target melody track from the target melody file, wherein the target melody track comprises a plurality of melody bars, each melody bar comprises at least one music beat, and each music beat comprises at least one melody note;
determining the beat duration of a first music distribution track according to the duration of the music beats in the target melody track, wherein the number of bars and the number of beats of the first music distribution track are the same as those of the target melody track;
Mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain a first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere score contents corresponding to each music beat according to the first pitch corresponding to each music beat, and writing the first tension atmosphere score contents corresponding to each music beat into the corresponding score beats of the first score track based on the score beat time length of the first score track;
and combining the target melody track with the first musical score track written with the first tension musical score content to obtain a musical score file of the target melody track and outputting the musical score file.
2. The method of claim 1, wherein the combining the target melody track with the first musical score track after writing the first ambiance musical score content, before obtaining the musical score file of the target melody track and outputting, further comprises:
acquiring the start-stop time period of each melody note in the target melody track;
Writing a preset tone atmosphere chord into a tone allocation time period corresponding to the start-stop time period of each melody note of the target melody track in a second tone allocation track;
the step of combining the target melody track and the first musical score track written with the first tension musical score content to obtain and output a musical score file of the target melody track, comprising:
and combining the target melody track, the first musical score track written with the first tone allocation content and the second musical score track written with the tone allocation chord to obtain and output the musical score file of the target melody track.
3. The method according to any one of claims 1-2, wherein the generating the first ambience score content corresponding to the respective music tempo from the first pitch corresponding to the respective music tempo and writing the first ambience score content corresponding to the respective music tempo into the corresponding score tempo of the first score track based on the score tempo duration of the first score track comprises:
obtaining the number of the rotary rhythm bars in the target melody track and dividing the number of the bars into at least 2 development stages;
Generating tension atmosphere score contents corresponding to each music beat of each development stage according to the score rules corresponding to each development stage of the at least 2 development stages and the first pitch corresponding to each music beat of each development stage, and writing the tension atmosphere score contents corresponding to each music beat into the corresponding score beat of each development stage of the first music distribution rail based on the score beat duration of the first music distribution rail.
4. A method according to claim 3, characterized in that the number of bars is divided into 3 development phases, comprising in particular: a first development stage, a second development stage, and a third development stage;
the generating, according to the score rules corresponding to each of the at least 2 development stages and the first pitches corresponding to each of the music beats of each of the development stages, the stress score content corresponding to each of the music beats of each of the development stages, and writing the stress score content corresponding to each of the music beats into the corresponding score beat of each of the development stages of the first music score rail based on the score beat duration of the first music score rail, includes:
For any music beat I in the first development stage, determining a music beat I corresponding to the music beat I on the first music distribution track according to the music beat I and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat I into the first half beat of the music beat I, and writing a pitch lower than the first pitch corresponding to the music beat I by half into the second half beat of the music beat I;
for any music beat J in the second development stage, determining a music beat J corresponding to the music beat J on the first music distribution track according to the music beat J and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat J into the first 1/3 beat of the music beat J, writing a pitch lower than the first pitch corresponding to the music beat J by half a tone between the 1/3 beat and the 2/3 beat of the music beat J, and writing a pitch higher than the first pitch corresponding to the music beat J by half a tone into the last 1/3 beat of the music beat J;
for any music beat K in the third development stage, determining a music beat K corresponding to the music beat K on the first music distribution track according to the music beat K and the music beat duration of the first music distribution track, writing a first pitch corresponding to the music beat K into the first 1/4 beat of the music beat K, writing a pitch lower than the first pitch corresponding to the music beat K by one tone between the 1/4 beat and the 2/4 beat of the music beat K, writing a pitch lower than the first pitch corresponding to the music beat K by half tone between the 2/4 beat and the 3/4 beat of the music beat K, and writing a pitch higher than the first pitch corresponding to the music beat K by half tone into the last 1/4 beat of the music beat K.
5. The method according to claim 2, wherein the writing of the preset ambience chord into the second musical score track within the musical score time period corresponding to the start-stop time period of each melody note of the target melody track includes:
obtaining the number of the rotary rhythm bars in the target melody track and dividing the number of the bars into at least 2 development stages;
and writing the tone atmosphere chord corresponding to each development stage of the at least 2 development stages into the matching time period corresponding to the starting and ending time period of each melody note of the target melody track in the corresponding development stage of the second matching musical track.
6. The method according to claim 5, characterized in that the number of bars is divided into 3 development phases, comprising in particular: a first development stage, a second development stage, and a third development stage; the second match content includes a third chord, a seventh chord or a seventh chord;
the writing the tone of the tone atmosphere corresponding to each of the at least 2 development stages into the score period corresponding to the start-stop period of each melody note of the target melody track in the corresponding development stage of the second score track includes:
Acquiring a match time period corresponding to a start-stop time period of each melody note in the first development stage, and writing a minus chord or a plus chord in each match time period of the first development stage of a second match musical track;
acquiring a matching time period corresponding to a start-stop time period of each melody note in the second development stage, and writing a seventh chord or a third chord in each matching time period of the second development stage of the second matching musical sound track;
and acquiring the coordination time periods corresponding to the start-stop time periods of the melody notes in the third development stage, and writing the seventh chord or the seventh chord in the coordination time periods of the third development stage of the second coordination music track.
7. A melody score apparatus, comprising:
the first obtaining module is used for obtaining an original melody file comprising a plurality of melody notes, and obtaining at least one target melody note from the original melody file, wherein the original melody file comprises a starting time and an ending time of each melody note, and the target melody note is used for representing even melody notes in the original melody file; advancing the starting time of each target melody note in the at least one target melody note by a target time threshold corresponding to each target melody note, and advancing the ending time of a preceding melody note of each target melody note by the target time threshold to obtain a target melody file; obtaining a target melody track from the target melody file, wherein the target melody track comprises a plurality of melody bars, each melody bar comprises a plurality of music beats, and each music beat comprises at least one melody note;
The determining module is used for determining the beat matching time length of a first musical score track according to the time length of the musical beats in the target melody track, wherein the number of bars and the number of beats of the first musical score track are the same as those of the target melody track;
the first writing module is used for mapping the pitch of the reference melody notes of each music beat in the target melody track to obtain the first pitch corresponding to each music beat in the target melody track based on the mapping relation between the affiliated gamut and the first gamut of the target melody track, generating first tension atmosphere score contents corresponding to each music beat according to the first pitch corresponding to each music beat, and writing the first tension atmosphere score contents corresponding to each music beat into the corresponding score beats of the first score track based on the score beat time length of the first score track;
and the output module is used for combining the target melody track with the first musical score track written with the first tension atmosphere musical score content to obtain and output a musical score file of the target melody track.
8. A terminal comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is adapted to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1-6.
CN201910014556.9A 2019-01-04 2019-01-04 Melody matching method and device Active CN109545177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910014556.9A CN109545177B (en) 2019-01-04 2019-01-04 Melody matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910014556.9A CN109545177B (en) 2019-01-04 2019-01-04 Melody matching method and device

Publications (2)

Publication Number Publication Date
CN109545177A CN109545177A (en) 2019-03-29
CN109545177B true CN109545177B (en) 2023-08-22

Family

ID=65834256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910014556.9A Active CN109545177B (en) 2019-01-04 2019-01-04 Melody matching method and device

Country Status (1)

Country Link
CN (1) CN109545177B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110769309B (en) 2019-11-04 2023-03-31 北京字节跳动网络技术有限公司 Method, device, electronic equipment and medium for displaying music points
CN110827788B (en) * 2019-12-02 2023-04-18 北京博声音元科技有限公司 Music playing simulation method and device
CN111681631B (en) * 2020-04-30 2024-05-10 平安科技(深圳)有限公司 Collocation harmony method, collocation harmony device, electronic equipment and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101203904A (en) * 2005-04-18 2008-06-18 Lg电子株式会社 Operating method of a music composing device
JP2010008518A (en) * 2008-06-24 2010-01-14 Sony Computer Entertainment Inc Music production apparatus, method of producing music, and program
CN101796587A (en) * 2007-09-07 2010-08-04 微软公司 Automatic accompaniment for vocal melodies
CN105161087A (en) * 2015-09-18 2015-12-16 努比亚技术有限公司 Automatic harmony method, device, and terminal automatic harmony operation method
CN107301857A (en) * 2016-04-15 2017-10-27 青岛海青科创科技发展有限公司 A kind of method and system to melody automatically with accompaniment
CN109086416A (en) * 2018-08-06 2018-12-25 中国传媒大学 A kind of generation method of dubbing in background music, device and storage medium based on GAN

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1666967B1 (en) * 2004-12-03 2013-05-08 Magix AG System and method of creating an emotional controlled soundtrack
US9773486B2 (en) * 2015-09-28 2017-09-26 Harmonix Music Systems, Inc. Vocal improvisation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101203904A (en) * 2005-04-18 2008-06-18 Lg电子株式会社 Operating method of a music composing device
CN101796587A (en) * 2007-09-07 2010-08-04 微软公司 Automatic accompaniment for vocal melodies
JP2010008518A (en) * 2008-06-24 2010-01-14 Sony Computer Entertainment Inc Music production apparatus, method of producing music, and program
CN105161087A (en) * 2015-09-18 2015-12-16 努比亚技术有限公司 Automatic harmony method, device, and terminal automatic harmony operation method
CN107301857A (en) * 2016-04-15 2017-10-27 青岛海青科创科技发展有限公司 A kind of method and system to melody automatically with accompaniment
CN109086416A (en) * 2018-08-06 2018-12-25 中国传媒大学 A kind of generation method of dubbing in background music, device and storage medium based on GAN

Also Published As

Publication number Publication date
CN109545177A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109545177B (en) Melody matching method and device
US8907197B2 (en) Performance information processing apparatus, performance information processing method, and program recording medium for determining tempo and meter based on performance given by performer
WO2015053278A1 (en) Technique for reproducing waveform by switching between plurality of sets of waveform data
JP2008250008A (en) Musical sound processing apparatus and program
JP6011219B2 (en) Audio file generation program and audio file generation apparatus
US9064485B2 (en) Tone information processing apparatus and method
JP3915807B2 (en) Automatic performance determination device and program
WO2021060493A1 (en) Information processing method, estimation model construction method, information processing device, and estimation model constructing device
WO2023124472A1 (en) Midi music file generation method, storage medium and terminal
JP6597553B2 (en) Harmony information generation apparatus, harmony information generation program, and harmony information generation method
JP2009230007A (en) Performance information display and program
JP2761897B2 (en) Automatic rhythm playing device
JP5412766B2 (en) Electronic musical instruments and programs
CN110827788A (en) Music playing simulation method and device
JP3620396B2 (en) Information correction apparatus and medium storing information correction program
JP5151603B2 (en) Electronic musical instruments
JP6464853B2 (en) Audio playback apparatus and audio playback program
JP7332002B2 (en) Electronic musical instrument, method and program
JP5549325B2 (en) Sound processor
JP2009058636A (en) Effect-imparting apparatus
JP4345010B2 (en) Pitch change amount determination method, pitch change amount determination device, and program
JP2005017676A (en) Automatic music player and program
JP2016057389A (en) Chord determination device and chord determination program
JP3859139B2 (en) Arrangement apparatus and arrangement method
JP2929498B2 (en) Electronic musical instrument

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
GR01 Patent grant
GR01 Patent grant