Midi music file generation method, storage medium and terminal

By generating Midi music files containing fingering, play, scale and play force, the problem of difficulty for players to know notes and tones is solved, and the effect of quickly mastering playing skills is achieved.

CN114267318BActive Publication Date: 2025-04-29TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111676119.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-04-29
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

When the player plays music, it is difficult to know when and what notes and tones to use, which makes it difficult to practice.

Method used

By generating a Midi music file, including the fingering, playing method, scale and corresponding playing force of the instrument, it helps users practice playing the instrument.

Benefits of technology

Help the player understand the way each chord is played, improve the stable playing speed and chord switching speed, quickly master the playing skills, and effectively assist the instrument practice.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114267318B_ABST
    Figure CN114267318B_ABST
Patent Text Reader

Abstract

The present application provides a method for generating a Midi music file, including: obtaining the score data, the instrument to be played and the chord fingering data table of the music to be configured; determining the number of tracks in the Midi music file according to the number of strings of the instrument to be played; reading the chords in the score data, calling the rhythm type data table to determine the string number of the corresponding chord of the instrument to be played; calling the chord fingering data table to query the fingering corresponding to the string number to be played; determining the scale sequence corresponding to the fingering; determining the playing method of each beat in the scale sequence, writing the scale sequence and the corresponding playing method into each track, and obtaining a Midi music file. The present application facilitates the player to know the playing method of each chord, thereby stabilizing the playing speed according to the Midi music file, and effectively helping the instrument player to practice. The present application also provides a computer-readable storage medium and a terminal, which have the above-mentioned beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method for generating a Midi music file, a storage medium and a terminal. Background Art

[0002] Currently, when playing music, players often play according to the music score, but they do not know when to use which notes, which tones, etc., which causes considerable trouble to the players.

[0003] Therefore, how to assist users in practicing musical instruments is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] The purpose of this application is to provide a method, storage medium and terminal for generating a Midi music file, which can generate a Midi music file corresponding to music score data to assist users in practicing playing musical instruments.

[0005] In order to solve the above technical problems, this application provides a method for generating a Midi music file, and the specific technical solution is as follows:

[0006] Acquire the music score data of the music to be configured, and determine the corresponding musical instrument for playing the music to be configured;

[0007] Determine the number of tracks in the Midi music file according to the number of strings of the instrument;

[0008] Read the chords in the music score data, and call the rhythm type data table to determine the string number of the corresponding chord of the musical instrument;

[0009] Calling the chord fingering data table to query the fingering corresponding to the string number being played;

[0010] Determine the scale corresponding to the chord according to the fingering, and determine the scale sequence composed of the scale according to the chord sequence;

[0011] Determine the playing method of each beat in the scale sequence, write the scale sequence and the corresponding playing method into each track, and obtain the Midi music file.

[0012] Optionally, determining the playing method of each beat in the scale sequence includes:

[0013] Determine the playing rhythm pattern of the playing instrument and the number of beats per minute corresponding to the music score data;

[0014] Determine the playing strength rule according to the beats per minute;

[0015] Determining the number of times each beat is played according to the playing rhythm pattern;

[0016] The playing intensity of each beat in the scale sequence is determined according to the playing strength rule and the number of playing times corresponding to each beat.

[0017] Optionally, the playing rhythm type is a finger-playing rhythm type, and determining the playing intensity of each beat in the scale sequence according to the playing strength rule and the number of playing times corresponding to each beat includes:

[0018] Determine the playing intensity of the first playing of each beat according to the playing intensity rule;

[0019] Set the remaining number of times each beat is played to the playing intensity corresponding to the weak beat.

[0020] Optionally, the playing rhythm type is a strumming rhythm type, and determining the playing intensity of each beat in the scale sequence according to the playing strength rule and the number of playing times corresponding to each beat includes:

[0021] Determine the initial playing intensity according to the playing intensity rule;

[0022] Taking the preset number of beats as a cycle, starting from the initial playing intensity in each cycle, the playing intensity of each scale decreases each time the scale sequence is played, and the starting time of each scale playing increases.

[0023] Optionally, determining the playing intensity of each beat in the scale sequence according to the playing intensity rule and the number of playing times corresponding to each beat includes:

[0024] Get the beat intensity value table;

[0025] Determining the beat intensity of the beat each time the beat is played according to the playing strength rule;

[0026] Determine the playing intensity value corresponding to the beat intensity according to the beat intensity value table;

[0027] A mapping relationship between the playing intensity value and the playing times of the beat is established to obtain the playing intensity of each beat in the scale sequence.

[0028] Optionally, before calling the rhythm type data table to determine the string number of the chord corresponding to the playing instrument, the method further includes:

[0029] According to the rhythm patterns of the musical instruments, a rhythm pattern data table corresponding to each of the musical instruments is established.

[0030] Optionally, before searching a chord fingering data table according to the played string number to determine the fingering corresponding to the chord, the method further includes:

[0031] The fingerings of the musical instrument when playing chords are integrated to generate the chord fingering data table.

[0032] Optionally, after obtaining the Midi music file, the method further includes:

[0033] The beats per minute, the time signature of the music score data and the playing rhythm pattern are added to the Midi music file.

[0034] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned method when executed by a processor.

[0035] The present application also provides a terminal, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when calling the computer program in the memory.

[0036] The present application provides a method for generating a MIDI music file, comprising: obtaining music score data of music to be configured, and determining a corresponding instrument to be played for the music to be configured; determining the number of tracks in the MIDI music file according to the number of strings of the instrument to be played; reading chords in the music score data, calling a rhythm type data table to determine the string number of the chord corresponding to the instrument to be played; calling a chord fingering data table to query the fingering corresponding to the string number to be played; determining the scale corresponding to the chord according to the fingering, and determining a scale sequence composed of the scale according to the chord sequence; determining the playing method of each beat in the scale sequence, writing the scale sequence and the corresponding playing method into each track, and obtaining the MIDI music file.

[0037] This application generates a Midi music file that contains the fingering, strumming method, scale and corresponding playing force of the musical instrument, so that the player can know how to play each chord, thereby stabilizing the playing speed according to the Midi music file, speeding up the chord switching speed, quickly mastering various playing techniques, and combining playing and singing, effectively helping instrumentalists practice.

[0038] The present application also provides a computer-readable storage medium and a terminal, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0040] Figure 1 A flowchart of a method for generating a Midi music file provided in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of some chords and corresponding fingerings provided in the embodiments of the present application;

[0042] Figure 3 The guitar fretboard scale data provided in the embodiment of the present application is shown as follows:

[0043] Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0045] See also Figure 1 , Figure 1 A flowchart of a method for generating a Midi music file provided in an embodiment of the present application, the method comprising:

[0046] S101: Acquire music score data of the music to be configured, and determine the corresponding musical instrument for playing the music to be configured;

[0047] This step is intended to obtain the score data of the music to be configured, as well as the musical instrument that the user needs to play. The score data refers to a regular combination of various written symbols that record the pitch or rhythm of the music. Common simple musical notation, five-line musical notation and guitar musical notation can all be used as the score data in this embodiment. The score data mainly includes the chords of each score, and can also include the beats per minute (beat(ing) per minute, English abbreviation BPM), etc. The music to be configured can be the music prepared by the user to play, or the music specified by the user, etc. In addition, when determining the musical instrument, the playing rhythm type of the musical instrument can also be determined, which is used to determine the playing intensity later. The musical instrument in this step mainly refers to string instruments, including but not limited to ukulele, guitar, etc.

[0048] The chord fingering data table contains the chords and the corresponding fingerings used when playing, as well as the strings that are not played when playing. Figure 2 , Figure 2The schematic diagram of some chords and corresponding fingerings provided in the embodiment of the present application includes three chords: Em, G and C. The chord playing data table can be directly searched to determine the fingering of the chord.

[0049] It is easy to understand that this embodiment assumes that the chord fingering data table already exists before executing this step. It can be generated in the above steps of this embodiment, or obtained in the above steps of this embodiment. The generation or acquisition process of the chord fingering data table can also be completed before executing this embodiment. There is no specific limitation on how to generate or obtain the chord fingering data table. It mainly includes three parts: chord name, fingering and unplayed strings. The following table 1 is Figure 2 Chord fingering data table corresponding to three chords:

[0050] Table 1 Chord fingering data table

[0051]

[0052] Of course, Table 1 is only a chord fingering data table corresponding to some chords, and those skilled in the art are capable of confirming the fingering operations corresponding to various chords under different playing rhythm patterns of different playing instruments. In other words, those skilled in the art are capable of querying the chord fingering data table to determine the fingering of any chord when performing this step.

[0053] In a specific implementation process of this step, the user can input the music score data and the playing instrument of the music to be configured, or the above content can be obtained or determined based on the analysis of the user input content. For example, if the user inputs the name of the song to be played, the corresponding music score data can be obtained according to the song name, and a recommended playing instrument can be provided for the user to choose, or the playing rhythm pattern corresponding to the music score data can be provided or the playable instrument can be provided for the user to choose. It is easy to understand that the playing rhythm patterns corresponding to different instruments may be different, which will not be limited by examples one by one here.

[0054] S102: Determine the number of tracks in the Midi music file according to the number of strings of the musical instrument;

[0055] This step is to determine the number of tracks. Usually, the number of strings of the instrument you play is the same as the number of tracks required, such as six tracks for a guitar and four tracks for a ukulele.

[0056] It is possible to configure a certain number of tracks. In this case, the number of tracks required is determined according to the number of strings of the musical instrument when executing this step, and the tracks are configured as the corresponding musical instrument.

[0057] In another implementation of this step, after the number of strings of the musical instrument is determined, the same number of tracks as the number of strings may be configured.

[0058] S103: reading the chords in the music score data, and calling the rhythm type data table to determine the string number of the corresponding chord of the musical instrument;

[0059] This step aims to determine the string number of the chord in the score data. The rhythm pattern data table contains the chords and the corresponding string numbers, as well as the playing time of each string number. It should be noted that the same chord uses different playing types, and the corresponding playing methods are different. See Table 2 and Table 3, Table 2 is a rhythm pattern data table of some chords and corresponding playing methods in the finger-playing rhythm pattern, and Table 3 is a rhythm pattern data table of some chords and corresponding playing methods in the strumming rhythm pattern:

[0060] Table 2 Some chords and corresponding playing methods in fingerstyle rhythm patterns

[0061]

[0062] Table 3 Some chords and corresponding strumming methods in the strumming rhythm pattern

[0063]

[0064] It can be seen from Table 2 and Table 3 that there are differences in the playing methods of the C chord in different playing rhythm patterns. Therefore, this step needs to read a chord in the music score data, and find the playing string number corresponding to this beat of the chord in the rhythm pattern data table according to its playing method. For example, if the first beat in the music score data is a C chord, in Table 3, the corresponding playing string number is found to be sweeping 5, 4, and 3 strings, and the duration is one beat. In addition, taking the C chord in Table 3 as an example, the first beat of the C chord needs to play 5 strings, 4 strings, and 3 strings. If there are two consecutive C chords, then it needs to be played three times afterwards, which are 4 strings, 3 strings, 2 strings, and 1 string for 0.5 beats, 4 strings, 3 strings, 2 strings, and 1 string for 0.25 beats, and 1 string, 2 strings, 3 strings, and 4 strings for 0.25 beats, which together constitute the C chord of the second beat.

[0065] S104: searching the chord fingering data table according to the string number to be played, and determining the fingering corresponding to the chord;

[0066] This step requires searching the chord fingering data table according to the string number determined in the previous step to determine the fingering corresponding to the chord.

[0067] In addition, it should be noted that the chord fingering data table contains the mapping relationship between chords and corresponding fingerings, that is, all mapping relationships containing chords and corresponding fingerings can be used as the chord fingering data table in this step, and its existence form is not limited to a table form, and can exist in a database or other data format that is easy to retrieve.

[0068] S105: determining a scale corresponding to the chord according to the fingering, and determining a scale sequence composed of the scales according to the order of the chords;

[0069] This step aims to determine the scale sequence corresponding to the fingering. Specifically, the fingering corresponding to each chord needs to be determined according to the process described above, and then the scale corresponding to the fingering needs to be determined. After the scales corresponding to all chords are determined, the scale sequence can be obtained according to the order of chords in the score data. It should be noted that each chord can obtain the corresponding scale according to the above process, and the scale sequence corresponds to all chords in the score data, that is, the chords correspond to the scales, and the score data corresponds to the scale sequence, and each chord is one beat.

[0070] When executing this step, the corresponding scale data table can be determined according to the scale data table of the musical instrument, and the scale data tables of different musical instruments are quite different. Figure 3 3 is a schematic diagram of guitar fingerboard scale data provided by an embodiment of the present application, which includes the relationship between string numbers, fret numbers and corresponding scales, for example Figure 3 In the figure, the 0th fret of string 1 corresponds to the treble 3, the 1st fret of string 1 corresponds to the treble 4, and the 0th fret of string 2 corresponds to the middle note 7. Since the fingering includes the number of strings and the number of frets, this step can determine the scale of each chord by referring to the scale data table, and further determine that the music score data contains the scale sequence corresponding to all chords according to the playing order of the chords.

[0071] S106: Determine the playing method of each beat in the scale sequence, write the scale sequence and the corresponding playing method into each audio track, and obtain the Midi music file.

[0072] This step aims to determine the playing method of each beat, which mainly refers to the playing strength and the number of times each beat is played. First of all, it is necessary to determine the playing method of each beat. The playing strength rule can be determined according to the beats per minute of the score data. The first beat of each measure in the score data is called a strong beat, and the remaining unit beats with strong sounds are called secondary strong beats. The unit beat without strong sounds is called a weak beat. The same time segments with strong and weak sounds are repeated in a certain order and are called beats. The unit of beat is called a beat. The same time segments that make up the beat are called unit beats. For example, in a two-beat beat, the unit beat is marked with a quarter note, which can be called a 4 / 2 beat. The number of beats for each of the common score data and the corresponding playing strength rules are as follows:

[0073] 2 / 4 time - there are only two beats in each measure, and the pattern of playing strength and weakness is: strong and weak.

[0074] 3 / 4 time - there are only three beats in each measure, and the pattern of playing strength and weakness is: strong, weak, weak.

[0075] 4 / 4 time - each measure has only four beats (but divisible by 2), and the pattern of playing strength and weakness is: strong, weak, secondary strong, weak.

[0076] 6 / 8 time - there are only six beats in each measure (but divisible by 2), and the pattern of playing strength and weakness is: strong, weak, weak, secondary strong, weak, weak.

[0077] The number of times you play varies depending on the rhythm pattern you play. For example, a strong beat may need to be played once, twice, or four times. The rhythm pattern you play refers to the way or technique of playing a musical instrument, including but not limited to the strumming rhythm pattern, finger-playing rhythm pattern, etc. After that, the playing intensity of each beat in the scale sequence can be determined based on the playing strength rule and the number of times each beat is played. The following uses two different rhythm patterns to explain how to determine the playing method of each beat in the scale sequence:

[0078] If the playing rhythm pattern is a finger-playing rhythm pattern, it includes the following steps:

[0079] The first step is to determine the playing intensity of the first playing of each beat according to the playing intensity rule;

[0080] Step 2: Set the remaining number of times each beat is played to the playing intensity corresponding to the weak beat.

[0081] Since each beat may need to be played multiple times, in the fingerstyle rhythm pattern, no matter how many times the beat needs to be played, the first time corresponds to the rule of playing strong and weak, and the remaining times of playing are set to the playing strength of the weak beat. For example, if the strong beat needs to be played twice, the strong beat is played according to strong→weak, and if it needs to be played four times, the strong beat is played according to strong→weak→weak→weak.

[0082] For another example, if the playing rhythm pattern is a strumming rhythm pattern, the method of determining the playing intensity is different from that of a finger-playing rhythm pattern. In this case, the following process is performed:

[0083] The first step is to determine the initial playing intensity according to the playing strength rule;

[0084] The second step is to use the preset number of beats as a cycle, and in each cycle, starting from the initial playing intensity, the playing intensity of each scale in the scale sequence decreases, and the starting time of each scale playing increases.

[0085] For the strumming rhythm type, the initial playing intensity is determined by the strength of the first beat. Since multiple strings are played simultaneously during the strumming process, the playing intensity of each subsequent beat decreases, which is less than the playing intensity of the first beat, and the starting time of the scale playing increases.

[0086] In order to more clearly describe the difference between two different playing rhythm types in determining the playing intensity, the playing intensity value is introduced as a reference below, and the beat intensity value table can be obtained first. In the beat intensity value table, different playing intensities, such as strong beats, secondary strong beats and weak beats, all contain corresponding playing intensity intervals. Generally speaking, 8 intensity intensities correspond to 0-127, a total of 128 playing intensity values, and the larger the value, the greater the playing intensity. Of course, those skilled in the art can also use other methods to represent the playing intensity, which is not limited by examples one by one here.

[0087] After obtaining the beat intensity value table, the beat intensity of each beat is determined according to the playing strength rule, and the playing intensity value corresponding to the beat intensity is determined according to the beat intensity value table. Finally, a mapping relationship between the playing intensity value and the number of times the beat is played is established to obtain the playing intensity of each beat in the scale sequence. After determining the playing intensity value of each beat one by one, the playing intensity of the beat can be obtained, and the playing intensity of the scale containing the beat can be further determined. Finally, the playing intensity of the scale sequence containing all scales can be obtained.

[0088] If you select the fingerstyle rhythm type, in order to make the Midi music file more in line with the actual playing rules, for the 4 / 4 beat rhythm, the change rule of the intensity is strong → weak → second strong → weak, then the playing intensity can be cycled from 80 → 40 → 60 → 40, indicating that the intensity value corresponding to the strong beat is 80, the intensity value corresponding to the weak beat is 40, and the intensity value corresponding to the second strong beat is 60. If the rhythm is 3 / 4, the change rule is strong → weak → weak, and the playing intensity can be cycled from 80 → 40 → 40 accordingly.

[0089] If you choose a strumming rhythm type, set the first scale as the strong beat, and the velocity value is also 80. Assuming that each beat uses the same decreasing value, and the velocity value decreases by 10 each time, the velocity value changes when playing: 80→70→60→50.

[0090] Taking the scale sequence <1,3,5> as an example, scale 1 corresponds to track 5, and the initial playing intensity can be set to 80, time 0 milliseconds; scale 3 corresponds to track 4, intensity 70, time 1 millisecond; scale 5 corresponds to track 3, intensity 60, time 2 seconds, and the intensity of the remaining tracks is set to 0. It should also be noted that the difference between the velocities in each cycle is not fixed, but in order to make the output sound closer to the original sound, the difference between the velocities of adjacent scales in each cycle can be set to a fixed value. As set above, the difference between the velocities of adjacent scales in each cycle is 10.

[0091] It can be seen that this embodiment needs to determine the scale and playing method for each chord in the music score data according to the process described above. After executing the above steps for all chords in the music score data, a complete scale sequence corresponding to the music score data can be obtained. In the specific implementation process, parallel threads can be used to execute the above process for each chord in the music score data respectively, or in each step, all chords in the music score data can be processed before entering the next step, and the music score data can also be processed in sections, etc. On the premise that all chords in the music score data are executed according to the process described above and the scale sequence and playing method are obtained, any parallel processing method or serial processing method should be within the protection scope of this application.

[0092] Finally, the scale sequence number and the corresponding playing intensity are written into each track, and the Midi music file can be obtained. It can be seen that the Midi music file should at least include the scale sequence and the corresponding playing intensity. In addition, for the same score data, if different playing instruments are adopted, multiple Midi files can be configured, and the option of playing instruments can also be configured in the display interface of the Midi file for the user to choose. Similarly, for different playing rhythm patterns, the modulation of the score data and other parameters can also be configured options for the user to choose, then the Midi file can include the scale sequence and the playing intensity when the different playing rhythm patterns are played. In order to facilitate the user to quickly understand the score data, the relevant parameters such as the beats per minute, the time signature of the score data and the playing rhythm pattern can also be added to the Midi music file.

[0093] The embodiment of the present application generates a Midi music file that contains the fingering, strumming method, scale and corresponding playing force of the musical instrument, so that the player can know the playing method of each chord, thereby stabilizing the playing speed according to the Midi music file, speeding up the chord switching speed, quickly mastering various playing techniques, and combining playing and singing, thereby effectively helping instrumentalists practice.

[0094] On the basis of the above embodiments, as a preferred embodiment, when obtaining the score data of the music to be configured and determining the corresponding musical instrument to be played by the music to be configured, the beats per minute corresponding to the score data can be directly determined. Then, when the Midi music file is finally obtained, the beats per minute can also be written into the Midi music file, thereby improving the song information contained in the Midi music file and facilitating the practice of instrumentalists.

[0095] Based on the above embodiment, as a preferred embodiment, before calling the rhythm type data table to determine the string number of the corresponding chord of the instrument, a rhythm type data table corresponding to each instrument can be established according to the rhythm type of the instrument when playing.

[0096] This embodiment aims to establish a rhythm type data table. It should be noted that this embodiment only requires that the establishment of the rhythm type data table be completed before calling the rhythm type data table to determine the string number of the corresponding chord of the playing instrument, and the order relationship between the establishment process and the aforementioned steps in the previous embodiment is not specifically limited. When constructing the rhythm type data table, corresponding rhythm type data tables are established for different playing instruments.

[0097] Based on the above embodiment, as a preferred embodiment, before searching the chord fingering data table according to the string number to be played and determining the fingering corresponding to the chord, the fingering of the instrument when playing the chord can be integrated to generate the chord fingering data table.

[0098] The present embodiment aims to establish a chord fingering data table. It should also be noted that the present embodiment only requires that the generation process of the chord fingering data table be completed before the chord fingering data table lookup is performed, and the order relationship between the establishment process and the aforementioned steps in the previous embodiment is not specifically limited.

[0099] In particular, it is possible to construct a rhythm type data table and a chord fingering data table, which can be stored in a Midi music file generation device or a cloud database as a basic database for Midi music file generation, so that they can be quickly called when Midi music files are generated, thereby improving the efficiency of Midi music file generation.

[0100] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0101] The present application also provides a terminal, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the terminal may also include various network interfaces, power supplies and other components. Figure 4 , Figure 4 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal in this embodiment may include: a processor 2101 and a memory 2102.

[0102] Optionally, the terminal may further include a communication interface 2103 , an input unit 2104 , a display 2105 , and a communication bus 2106 .

[0103] The processor 2101 , the memory 2102 , the communication interface 2103 , the input unit 2104 , and the display 2105 all communicate with each other via the communication bus 2106 .

[0104] In the embodiment of the present application, the processor 2101 may be a central processing unit (CPU), a specific application integrated circuit, a digital signal processor, a readily available programmable gate array or other programmable logic device, etc.

[0105] The processor may call the program stored in the memory 2102. Specifically, the processor may execute the operations executed by the terminal in the above embodiment.

[0106] The memory 2102 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present application, the memory at least stores a program for implementing the following functions:

[0107] Acquire the music score data of the music to be configured, and determine the corresponding musical instrument for playing the music to be configured;

[0108] Determine the number of tracks in the Midi music file according to the number of strings of the instrument;

[0109] Read the chords in the music score data, and call the rhythm type data table to determine the string number of the corresponding chord of the musical instrument;

[0110] Calling the chord fingering data table to query the fingering corresponding to the string number being played;

[0111] Determine the scale corresponding to the chord according to the fingering, and determine the scale sequence composed of the scale according to the chord sequence;

[0112] Determine the playing method of each beat in the scale sequence, write the scale sequence and the corresponding playing method into each audio track, and obtain the Midi music file. In a possible implementation method, the memory 2102 may include a program storage area and a data storage area, wherein the program storage area can store an operating system, and at least one application required for a function, etc.; the data storage area can store data created during the use of the computer.

[0113] In addition, the memory 2102 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0114] The communication interface 2103 may be an interface of a communication module, such as an interface of a GSM module.

[0115] The present application may further include a display 2105 and an input unit 2104 and the like.

[0116] Figure 4 The structure of the terminal shown does not constitute a limitation on the terminal in the embodiment of the present application. In actual applications, the terminal may include Figure 4 More or fewer components than shown, or combinations of certain components.

[0117] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

[0118] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for generating a Midi music file, characterized in that: include: Acquire the music score data of the music to be configured, and determine the corresponding musical instrument for playing the music to be configured; Determine the number of tracks in the Midi music file according to the number of strings of the instrument; Read the chords in the music score data, and call the rhythm type data table to determine the string number of the corresponding chord of the musical instrument; Calling the chord fingering data table to query the fingering corresponding to the string number being played; Determine the scale corresponding to the chord according to the fingering, and determine the scale sequence composed of the scale according to the chord sequence; Determine the playing method of each beat in the scale sequence, write the scale sequence and the corresponding playing method into each track, and obtain the Midi music file; The playing method includes the number of playing times and the playing intensity, and the determining of the playing method of each beat in the scale sequence includes: Determine the playing rhythm pattern of the playing instrument and the number of beats per minute corresponding to the music score data; Determine the playing strength rule according to the beats per minute; Determining the number of times each beat is played according to the playing rhythm pattern; The playing intensity of each beat in the scale sequence is determined according to the playing strength rule and the number of playing times corresponding to each beat.

2. The method for generating a Midi music file according to claim 1, characterized in that: The playing rhythm type is a finger-playing rhythm type, and the step of determining the playing intensity of each beat in the scale sequence according to the playing intensity rule and the number of playing times corresponding to each beat comprises: Determine the playing intensity of the first playing of each beat according to the playing intensity rule; Set the remaining number of times each beat is played to the playing intensity corresponding to the weak beat.

3. The method for generating a Midi music file according to claim 1, characterized in that: The playing rhythm type is a strumming rhythm type, and determining the playing intensity of each beat in the scale sequence according to the playing strength rule and the number of playing times corresponding to each beat includes: Determine the initial playing intensity according to the playing intensity rule; Taking the preset number of beats as a cycle, starting from the initial playing intensity in each cycle, the playing intensity of each scale decreases each time the scale sequence is played, and the starting time of each scale playing increases.

4. The method for generating a Midi music file according to claim 1, characterized in that: The step of determining the playing intensity of each beat in the scale sequence according to the playing intensity rule and the number of playing times corresponding to each beat comprises: Get the beat intensity value table; Determining the beat intensity of the beat each time the beat is played according to the playing strength rule; Determine the playing intensity value corresponding to the beat intensity according to the beat intensity value table; A mapping relationship between the playing intensity value and the playing times of the beat is established to obtain the playing intensity of each beat in the scale sequence.

5. The method for generating a Midi music file according to claim 1, characterized in that: Before calling the rhythm pattern data table to determine the string number of the chord corresponding to the musical instrument, the method further includes: According to the rhythm patterns of the musical instruments, a rhythm pattern data table corresponding to each of the musical instruments is established.

6. The method for generating a Midi music file according to claim 1, characterized in that: Before searching the chord fingering data table according to the played string number to determine the fingering corresponding to the chord, the method further includes: The fingerings of the musical instrument when playing chords are integrated to generate the chord fingering data table.

7. The method for generating a Midi music file according to claim 1, characterized in that: After obtaining the Midi music file, it also includes: The beats per minute, the time signature of the music score data and the playing rhythm pattern are added to the Midi music file.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a Midi music file as described in any one of claims 1 to 7 are implemented.

9. A terminal, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the method for generating a Midi music file as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Operating method of a music composing device

    CN101203904A