Digital human real-time playing animation generation method and device, equipment and storage medium
By obtaining the pressing fret sequence of the guitar score, the guitar fingering sequence and hand-playing hand shape are generated, the problem of unreal and unsmooth digital human performance animation is solved, and the performance effect similar to that of real-person playing is achieved.
Patent Information
- Application Number
- CN202311726629.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-01-10
AI Technical Summary
The prior art is difficult to automatically analyze the most likely method of pressing fingering when playing guitars in real people, resulting in the digital human performance animation being unreal and unsmooth.
By obtaining the pressed fret sequence of the target guitar score, a guitar fingering sequence is generated, and the hand-playing hand shape is further generated, and inserted into the preset timeline as a key animation frame, driving the digital person to perform guitar.
It realizes the guitar playing animation that digital people can naturally and smoothly simulate real people playing, enhancing the authenticity and fluency of the performance.
Smart Images

Figure CN119295613A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a method, device, equipment, and storage medium for generating real-time playing animations of digital humans on a guitar. Background Art
[0002] In practical applications, in some scenarios, it is necessary to automatically analyze the most likely fingering when a real person plays the guitar based on a guitar tablature, so that the real fingering can be used to drive a digital human to play the guitar, making the performance of the digital human more real and smooth.
[0003] When a real person plays the guitar, not only will they press the corresponding frets and strings according to the current note to be played, but they will also tend to minimize the change of fingering as much as possible, which poses a technical difficulty for automatically analyzing the most likely fingering when a real person plays the guitar. Therefore, it is difficult to obtain real and smooth playing animations of digital humans. Summary of the Invention
[0004] Embodiments of the present invention provide a method, device, equipment, and storage medium for generating real-time playing animations of digital humans on a guitar, so as to generate real and smooth playing animations of digital humans.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating real-time playing animations of digital humans on a guitar, the method comprising:
[0006] Obtain a sequence of fret presses corresponding to a target guitar tablature, where the target guitar tablature includes multiple notes, and each fret press in the sequence of fret presses corresponds to one of the multiple notes;
[0007] Generate a sequence of guitar fingering based on the sequence of fret presses;
[0008] Generate a hand playing shape based on the sequence of guitar fingering;
[0009] Insert the hand playing shape into a preset timeline, and use the hand playing shape as a key animation frame in the preset timeline;
[0010] Redirect the key animation frame to a digital human, so as to drive the digital human to play the guitar through the key animation frame.
[0011] Optionally, the generating a sequence of guitar fingering based on the sequence of fret presses includes:
[0012] Successively obtain the fret presses in the sequence of fret presses, and based on the currently obtained fret press, fill in a value corresponding to the fret to be pressed at a position corresponding to the string to be pressed in the current array until it is detected that a value has been filled in at the position where a value needs to be filled in currently;
[0013] Generate a new array and initialize the array, and then execute the step of filling the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret based on the currently acquired pressed fret string, until all the pressed fret strings in the pressed fret string sequence are traversed;
[0014] Output multiple arrays as guitar fingering sequences in the order they were generated.
[0015] Optionally, the step of obtaining a fret pressing sequence corresponding to a target guitar score includes:
[0016] According to the pre-established correspondence between the notes and the pressed fret strings, the multiple notes included in the target guitar tablature are converted into the pressed fret string sequence.
[0017] Optionally, the array can be filled with at most six values, corresponding to the six strings of the guitar in sequence;
[0018] The generating a new array and initializing the array comprises:
[0019] Generate a new array;
[0020] Initialize the value at each position in the array to a first preset value.
[0021] Optionally, the step of filling in a value corresponding to the to-be-pressed fret at a position corresponding to the to-be-pressed string in the current array based on the currently-acquired pressed fret string includes:
[0022] Determine the string to be pressed among the currently acquired pressed fret strings;
[0023] Determine the position corresponding to the string to be pressed in the current array;
[0024] If the to-be-pressed fret in the currently acquired pressed fret string is not empty, then the same value as that of the to-be-pressed fret is filled in the determined position.
[0025] Optionally, the method further comprises:
[0026] If the to-be-pressed fret in the currently acquired pressed fret string is empty, a second preset value is filled in the determined position.
[0027] In a second aspect, an embodiment of the present invention provides a device for generating a digital human playing animation in real time, comprising:
[0028] An acquisition module, configured to acquire a pressed fret string sequence corresponding to a target guitar tablature, wherein the target guitar tablature includes a plurality of notes, and each pressed fret string in the pressed fret string sequence corresponds to the plurality of notes one by one;
[0029] A generating module, for generating a guitar fingering sequence based on the fret pressing sequence; and generating a hand playing shape based on the guitar fingering sequence;
[0030] An inserting module, used for inserting the hand playing hand shape into a preset timeline, and using the hand playing hand shape as a key animation frame in the preset timeline;
[0031] The redirection module is used to redirect the key animation frames to the digital human, so as to drive the digital human to play the guitar through the key animation frames.
[0032] Optionally, the generating module is used to:
[0033] sequentially acquiring the pressed fret strings in the pressed fret string sequence, and based on the currently acquired pressed fret string, filling in the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret, until it is detected that the position currently requiring the value to be filled in has been filled in with the value;
[0034] Generate a new array and initialize the array, and then execute the step of filling the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret based on the currently acquired pressed fret string, until all the pressed fret strings in the pressed fret string sequence are traversed;
[0035] Output multiple arrays as guitar fingering sequences in the order they were generated.
[0036] Optionally, the acquisition module is used to:
[0037] According to the pre-established correspondence between the notes and the pressed fret strings, the multiple notes included in the target guitar tablature are converted into the pressed fret string sequence.
[0038] Optionally, the array can be filled with at most six values, corresponding to the six strings of the guitar in sequence;
[0039] The generating module is used for:
[0040] Generate a new array;
[0041] Initialize the value at each position in the array to a first preset value.
[0042] Optionally, the generating module is used to:
[0043] Determine the string to be pressed among the currently acquired pressed fret strings;
[0044] Determine the position corresponding to the string to be pressed in the current array;
[0045] If the to-be-pressed fret in the currently acquired pressed fret string is not empty, then the same value as that of the to-be-pressed fret is filled in the determined position.
[0046] Optionally, the generating module is further used to:
[0047] If the to-be-pressed fret in the currently acquired pressed fret string is empty, a second preset value is filled in the determined position.
[0048] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the method for generating a real-time playing animation of a digital human in the first aspect.
[0049] In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the method for generating a real-time playing animation of a digital human in the first aspect.
[0050] By adopting the present invention, a natural and smooth guitar fingering sequence that is in line with the actual performance of a real person can be automatically analyzed based on the fret pressing sequence corresponding to the target guitar score. Based on the guitar fingering sequence, a hand playing shape can be generated, and then the hand playing shape can be inserted into the preset timeline, and the hand playing shape can be used as a key animation frame in the preset timeline. Finally, the key animation frame can be redirected to the digital human to drive the digital human to play the guitar through the key animation frame. By adopting the algorithm provided by the present invention, the digital human can interpret the playing technique similar to that of a real person. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A schematic diagram of a flow chart of a method for generating a real-time playing animation of a digital human provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of a process for generating a guitar fingering sequence provided by an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of a real person's fingering for playing provided by an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of the structure of a device for generating a digital human playing animation in real time provided by an embodiment of the present invention;
[0056] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0059] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0060] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0061] Figure 1 A flowchart of a method for generating a real-time playing animation of a digital human provided by an embodiment of the present invention. The method can be applied to electronic devices, wherein the electronic devices can be, for example, terminals, servers and other devices.
[0062] like Figure 1 As shown, the method comprises the following steps:
[0063] 101. Obtain a pressed fret string sequence corresponding to a target guitar score, wherein the target guitar score includes a plurality of notes, and each pressed fret string in the pressed fret string sequence corresponds to the plurality of notes one by one.
[0064] 102. Generate a guitar fingering sequence based on a fret-pressed string sequence.
[0065] 103. Generate hand playing shape based on guitar fingering sequence.
[0066] 104. Insert the hand playing shape into the preset timeline, and use the hand playing shape as the key animation frame in the preset timeline.
[0067] 105. Redirect the key animation frames to the digital human to drive the digital human to play the guitar through the key animation frames.
[0068] In practical applications, with the development of science and technology, more and more tasks can be completed by digital humans, for example, digital humans can broadcast news, play musical instruments, etc. In an embodiment of the present invention, a method for generating a real-time playing animation of a digital human is provided, the purpose of which is to automatically analyze how to simulate the playing of a real person naturally and smoothly based on a target guitar score to autonomously complete the performance.
[0069] It can be understood that the target guitar score is a musical score, and the target guitar score may include multiple notes, and the fret string sequence corresponding to the target guitar score can be obtained. For example, the simplest C key is used as an example:
[0070] 1. Do: Press the third fret of the fifth string with your left hand and pluck the fifth string with your right hand.
[0071] 2. re: Do not press the left hand, and pluck the fourth string with the right hand.
[0072] 3. mi: Press the second fret of the fourth string with your left hand and pluck the fourth string with your right hand.
[0073] 4. fa: Press the third fret of the fourth string with your left hand and pluck the fourth string with your right hand.
[0074] 5. so: Do not press the left hand, and pluck the third string with the right hand.
[0075] 6. la: Press the second fret of the third string with your left hand and pluck the third string with your right hand.
[0076] 7. xi: Do not press the left hand, but pluck the second string with the right hand.
[0077] As can be seen from the above examples, for each note in the key of C, there are corresponding playing techniques for the left hand and the right hand. Since the right hand is simply plucking or sweeping the strings, in the embodiment of the present invention, only the playing technique of the left hand is temporarily concerned. For the left hand, in order to play the corresponding notes, it is necessary to press the corresponding strings and frets, which can be referred to as frets, and there is a corresponding relationship between the notes and the frets. Of course, in addition to the C key exemplified above, there is a corresponding relationship between the notes and the frets in other tones, and the corresponding relationship between different notes and frets in different tones can be extracted.
[0078] Based on this, optionally, the process of obtaining the pressed fret string sequence corresponding to the target guitar score can be implemented as follows: according to the pre-established correspondence between the notes and the pressed fret strings, multiple notes included in the target guitar score are converted into the pressed fret string sequence.
[0079] In practical applications, each note in the target guitar score can be traversed one by one, and each traversed note can be converted into a corresponding fret string through the above correspondence, and finally a fret string pressing sequence can be output.
[0080] After determining the fret pressing sequence, it is possible to know which frets need to be pressed in sequence. Based on this, a guitar fingering sequence can be determined based on the fret pressing sequence, and the guitar fingering sequence can be a natural and smooth guitar fingering that simulates a real person. The specific method for determining the guitar fingering sequence will be given below and will not be described here.
[0081] After the guitar fingering sequence is determined, the hand playing shape can be generated based on the guitar fingering sequence. For example, when it is determined that do is to hold down the third fret of the fifth string, the hand shape of the digital human's hand holding down the third fret of the fifth string can be generated accordingly. In this way, the hand playing shape corresponding to each guitar fingering in the guitar fingering sequence can be determined one by one.
[0082] It can be understood that since the duration of each note can be different, the hand playing shape generated above can be inserted into the preset timeline according to the duration of each note and other factors affecting the time to play a certain note, and the hand playing shape can be used as the key animation frame in the preset timeline.
[0083] After obtaining the key animation frames, the key animation frames can be redirected to the digital human to drive the digital human to play the guitar through the key animation frames. In this way, based on the guitar fingering sequence obtained by the algorithm analysis provided by the embodiment of the present invention, a real-time playing animation can be generated in which the digital human plays naturally and smoothly, which is similar to the performance of a real person.
[0084] The specific implementation method of generating a guitar fingering sequence in an embodiment of the present invention will be described in detail below.
[0085] like Figure 2 As shown, the process of generating a guitar fingering sequence may include the following steps:
[0086] 201. Obtain pressed fret strings in a pressed fret string sequence in sequence, and based on the currently obtained pressed fret string, fill in the position corresponding to the to-be-pressed fret in the current array with a value corresponding to the to-be-pressed fret, until it is detected that the position currently requiring the value to be filled in has been filled in with a value.
[0087] 202. Generate a new array and initialize the array, and then execute the step of filling the position corresponding to the to-be-pressed fret in the current array with the value corresponding to the to-be-pressed fret based on the currently acquired pressed fret string, until all the pressed fret strings in the pressed fret string sequence are traversed.
[0088] 203. Output the multiple arrays in sequence as guitar fingering sequences according to the order in which they are generated.
[0089] In practical applications, before processing the fret string sequence, an array may be created as the current array A, and the array A may be initialized. The initialization process may be to initialize the values at each position in the array to a first preset value, wherein the first preset value may be -1, and the first preset value may mean that the current position has not been assigned a fret. Based on this, there is an array A [-1, ..., -1].
[0090] Subsequently, the pressed fret strings in the pressed fret string sequence can be obtained in sequence, and based on the currently obtained pressed fret strings, the values corresponding to the frets to be pressed are filled in the positions corresponding to the strings to be pressed in the current array until it is detected that the values have been filled in the positions where the values currently need to be filled in.
[0091] Optionally, based on the currently acquired pressed fret string, the process of filling in the position corresponding to the string to be pressed in the current array with a value corresponding to the fret to be pressed can be implemented as follows: determining the string to be pressed in the currently acquired pressed fret strings; determining the position corresponding to the string to be pressed in the current array; if the fret to be pressed in the currently acquired pressed fret string is not empty, filling in the determined position with the same value as the fret to be pressed.
[0092] Assuming that the currently acquired pressed fret string is pressed fret string i, the string p to be pressed of pressed fret string i can be acquired. For example, if pressed fret string i is the third fret of the fifth string, then the string p to be pressed of pressed fret string i is the fifth string, and the position corresponding to the string p to be pressed in array A is the fifth numerical position.
[0093] Next, it can be determined whether the fret s to be pressed in the pressed fret string i is empty. Since it is not necessary to press a specific fret string when playing certain notes, the frets to be pressed in the pressed fret strings corresponding to some notes are actually empty. Based on this, it can be determined whether the fret s to be pressed in the pressed fret string i is empty. If the fret s to be pressed is not empty, the same value as the fret s to be pressed can be filled in the numerical position determined above in array A. Taking the above example again, if the fret s to be pressed of the pressed fret i is the third fret, then "3" can be filled in the fifth numerical position in array A, that is, array A [-1, -1, -1, -1, 3, ...].
[0094] On the other hand, if the fret s to be pressed is empty, optionally, a second preset value may be filled in the above-determined value position in array A. The second preset value may be, for example, 0. The second preset value may mean an empty string.
[0095] To facilitate understanding, the following example illustrates the process of filling in the array.
[0096] Assume that the sequence of pressed fret strings is: the third fret of the fifth string, the second fret of the third string, the left hand does not press, the right hand plays the fourth string... First, we can get the first pressed fret string 1 in the pressed fret string sequence. The string to be pressed in the pressed fret string 1 is the fifth string, so the value position to be filled in array A is the fifth value position. The fret to be pressed in the pressed fret string 1 is the third fret, so we can fill "3" in the fifth value position in array A, and we have A[-1, -1, -1, -1, 3, ...].
[0097] Next, get the second pressed fret string 2 in the pressed fret string sequence. The string to be pressed in pressed fret string 2 is the third string, so the numerical position to be filled in array A is the third numerical position. The fret to be pressed in pressed fret string 2 is the second fret, so "2" can be filled in the third numerical position in array A, and there is A[-1, -1, 2, -1, 3, ...].
[0098] Then, get the third pressed fret string 3 in the pressed fret string sequence. Pressed fret string 3 is not pressed by the left hand, and the right hand needs to play the fourth string. The numerical position corresponding to the string that the right hand needs to play can be determined in array A, that is, the fourth numerical position in array A. The fret to be pressed in pressed fret string 3 is empty, so the fourth numerical position in array A can be filled with "0", and there is A[-1, -1, 2, 0, 3, ...].
[0099] In addition, continuing with the above example, assuming that the fourth pressed fret string 4 in the above pressed fret string sequence is the third fret of the fourth string, then the numerical position that needs to be filled in array A is the fourth numerical position, and at this time, the fourth numerical position in array A already has a filled-in numerical value "0". It should be noted that for array A, as long as the numerical value at any numerical position is not "-1", it can be considered that the numerical position has been filled with a numerical value. In this case, it means that array A has been filled, array A can be output, and a new array can be recreated. Based on this, optionally, a new array can be generated; the numerical values at each position in the array are initialized to a first preset numerical value. Assuming that the newly generated array is array B, there is array B [-1, ..., -1].
[0100] In some optional embodiments, since a guitar generally has six strings, the created array can be set to an array containing six numerical positions, i.e., [-1, -1, -1, -1, -1]. It can be understood that the six numerical positions in the array correspond to the six strings of the guitar one by one.
[0101] In the embodiment of the present invention, the method described above can be used to fill in the current array with values until it is found that the position where the value is currently required has been filled in. At this time, a new array can be created and initialized, and then the new array can continue to be filled with values according to the method described above. The above scheme can be executed cyclically until all the pressed fret strings in the pressed fret string sequence have been filled in a certain array accordingly. Finally, these arrays can be output in sequence and used as guitar fingering sequences.
[0102] It should be noted that a single array in the guitar fingering sequence can also be called the longest invariant fingering unit. The longest invariant fingering unit means a minimum unit consisting of the maximum number of strings and frets that can be pressed by the left hand at the same time.
[0103] It is understandable that if Figure 3 As shown, in the process of real people playing, people most hope not to change the position of fingering as much as possible, that is, to be able to press the frets of multiple strings at one time. For example, taking a simple example, assuming that the frets to be pressed are the third fret of the fifth string and the second fret of the third string, when a real person plays, the left hand will not press the third fret of the fifth string only once, and after the right hand plays the fifth string, the left hand will change the fingering, that is, the left hand changes to the second fret position of the third string.
[0104] In practice, a real person would use the left hand to press the third fret of the fifth string and the second fret of the third string at the same time, and so on, that is, to press as many strings and frets as possible, as long as there is no conflict between the multiple strings and frets. Since when the left hand presses the fret of a string, as long as the right hand does not pluck the corresponding string, the corresponding sound will not be produced, which makes it possible for the left hand to press the frets of multiple strings at once. In other words, if the string is not open, the corresponding sound will only be played when the left hand presses the fret of a string and the right hand plucks the corresponding string. Therefore, the left hand can pre-press all the frets of the strings of the notes to be played at once.
[0105] Based on this, it is necessary to automatically analyze the most possible strings and frets that can be pressed each time when a real person plays based on the target guitar score. The algorithm introduced in the embodiment of the present invention can be used to extract the most possible strings and frets that can be pressed each time when a real person plays, and the extracted information is recorded in a complete array, that is, the longest invariant fingering unit. Then, by using the guitar fingering sequence (multiple longest invariant fingering units) extracted by the algorithm provided by the embodiment of the present invention to drive the digital human to play the guitar, the digital human's performance can be made more natural, smooth, and in line with the actual performance of the real person.
[0106] By adopting the present invention, a natural and smooth guitar fingering sequence that is in line with the actual performance of a real person can be automatically analyzed based on the fret pressing sequence corresponding to the target guitar score. Based on the guitar fingering sequence, a hand playing shape can be generated, and then the hand playing shape can be inserted into the preset timeline, and the hand playing shape can be used as a key animation frame in the preset timeline. Finally, the key animation frame can be redirected to the digital human to drive the digital human to play the guitar through the key animation frame. By adopting the algorithm provided by the present invention, the digital human can interpret the playing technique similar to that of a real person.
[0107] The following will describe in detail one or more embodiments of the digital human real-time playing animation generation device of the present invention. Those skilled in the art will appreciate that these digital human real-time playing animation generation devices can be configured using commercially available hardware components through the steps taught in this solution.
[0108] Figure 4 A schematic diagram of the structure of a device for generating a digital human playing animation in real time provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device comprises:
[0109] An acquisition module 41 is used to acquire a pressed fret string sequence corresponding to a target guitar tablature, wherein the target guitar tablature includes a plurality of notes, and each pressed fret string in the pressed fret string sequence corresponds to the plurality of notes one by one;
[0110] A generating module 42 is used to generate a guitar fingering sequence based on the fret pressing sequence; and to generate a hand playing shape based on the guitar fingering sequence;
[0111] An inserting module 43 is used to insert the hand playing hand shape into a preset time axis, and use the hand playing hand shape as a key animation frame in the preset time axis;
[0112] The redirection module 44 is used to redirect the key animation frames to the digital human, so as to drive the digital human to play the guitar through the key animation frames.
[0113] Optionally, the generating module 42 is used to:
[0114] sequentially acquiring the pressed fret strings in the pressed fret string sequence, and based on the currently acquired pressed fret string, filling in the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret, until it is detected that the position currently requiring the value to be filled in has been filled in with the value;
[0115] Generate a new array and initialize the array, and then execute the step of filling the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret based on the currently acquired pressed fret string, until all the pressed fret strings in the pressed fret string sequence are traversed;
[0116] Output multiple arrays as guitar fingering sequences in the order they were generated.
[0117] Optionally, the acquisition module 41 is used to:
[0118] According to the pre-established correspondence between the notes and the pressed fret strings, the multiple notes included in the target guitar tablature are converted into the pressed fret string sequence.
[0119] Optionally, the array can be filled with at most six values, corresponding to the six strings of the guitar in sequence;
[0120] The generating module 42 is used for:
[0121] Generate a new array;
[0122] Initialize the value at each position in the array to a first preset value.
[0123] Optionally, the generating module 42 is used to:
[0124] Determine the string to be pressed among the currently acquired pressed fret strings;
[0125] Determine the position corresponding to the string to be pressed in the current array;
[0126] If the to-be-pressed fret in the currently acquired pressed fret string is not empty, then the same value as that of the to-be-pressed fret is filled in the determined position.
[0127] Optionally, the generating module 42 is further configured to:
[0128] If the to-be-pressed fret in the currently acquired pressed fret string is empty, a second preset value is filled in the determined position.
[0129] Figure 4 The device shown can perform the aforementioned Figures 1 to 3The method for generating a real-time playing animation of a digital human provided in the illustrated embodiment, the detailed execution process and technical effects of which can be found in the description of the aforementioned embodiment, will not be repeated here.
[0130] In one possible design, the above Figure 4 The structure of the digital human real-time playing animation generation device shown can be realized as an electronic device, such as Figure 5 As shown, the electronic device may include: a processor 51 and a memory 52. The memory 52 stores executable code, and when the executable code is executed by the processor 51, the processor 51 can at least implement the above-mentioned Figures 1 to 3 The illustrated embodiment provides a method for generating a real-time playing animation of a digital human.
[0131] Optionally, the electronic device may further include a communication interface 53 for communicating with other devices.
[0132] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, wherein an executable code is stored on the non-transitory machine-readable storage medium. When the executable code is executed by a processor of an electronic device, the processor can at least implement the above-mentioned Figures 1 to 3 The illustrated embodiment provides a method for generating a real-time playing animation of a digital human.
[0133] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0134] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0135] The method for generating a digital human playing animation in real time provided by the embodiment of the present invention can be executed by a certain program / software, and the program / software can be provided by the network side. The electronic device mentioned in the above embodiment can download the program / software to a local non-volatile storage medium, and when it needs to execute the above digital human playing animation generation method in real time, the program / software is read into the memory by the CPU, and then the program / software is executed by the CPU to implement the method for generating a digital human playing animation in real time provided in the above embodiment. The execution process can refer to the above Figures 1 to 3 Instructions in .
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a digital human real-time playing animation, characterized in that: include: Acquire a pressed fret string sequence corresponding to a target guitar tablature, wherein the target guitar tablature includes a plurality of notes, and each pressed fret string in the pressed fret string sequence corresponds to the plurality of notes one by one; Generate a guitar fingering sequence based on the fret pressing sequence; Based on the guitar fingering sequence, generating a hand playing shape; Inserting the hand playing hand shape into a preset timeline, and using the hand playing hand shape as a key animation frame in the preset timeline; The key animation frames are redirected to the digital human, so as to drive the digital human to play the guitar through the key animation frames.
2. The method according to claim 1, characterized in that The step of generating a guitar fingering sequence based on the fret pressing sequence comprises: sequentially acquiring the pressed fret strings in the pressed fret string sequence, and based on the currently acquired pressed fret string, filling in the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret, until it is detected that the position currently requiring the value to be filled in has been filled in with the value; Generate a new array and initialize the array, and then execute the step of filling the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret based on the currently acquired pressed fret string, until all the pressed fret strings in the pressed fret string sequence are traversed; Output multiple arrays as guitar fingering sequences in the order they were generated.
3. The method according to claim 2, characterized in that The step of obtaining a fret string sequence corresponding to a target guitar score comprises: According to the pre-established correspondence between the notes and the pressed fret strings, the multiple notes included in the target guitar tablature are converted into the pressed fret string sequence.
4. The method according to claim 2, characterized in that: The array can be filled with at most six values, corresponding to the six strings of the guitar in sequence; The generating a new array and initializing the array comprises: Generate a new array; Initialize the value at each position in the array to a first preset value.
5. The method according to claim 2, characterized in that: The method of filling in a value corresponding to the to-be-pressed fret at a position corresponding to the to-be-pressed string in the current array based on the currently-acquired pressed fret string includes: Determine the string to be pressed among the currently acquired pressed fret strings; Determine the position corresponding to the string to be pressed in the current array; If the to-be-pressed fret in the currently acquired pressed fret string is not empty, then the same value as that of the to-be-pressed fret is filled in the determined position.
6. The method according to claim 5, characterized in that The method further comprises: If the to-be-pressed fret in the currently acquired pressed fret string is empty, a second preset value is filled in the determined position.
7. A device for generating a digital human playing animation in real time, characterized in that: include: An acquisition module, configured to acquire a pressed fret string sequence corresponding to a target guitar tablature, wherein the target guitar tablature includes a plurality of notes, and each pressed fret string in the pressed fret string sequence corresponds to the plurality of notes one by one; A generating module, for generating a guitar fingering sequence based on the fret pressing sequence; and generating a hand playing shape based on the guitar fingering sequence; An inserting module, used for inserting the hand playing hand shape into a preset timeline, and using the hand playing hand shape as a key animation frame in the preset timeline; The redirection module is used to redirect the key animation frames to the digital human, so as to drive the digital human to play the guitar through the key animation frames.
8. The device according to claim 7, characterized in that The generating module is used for: sequentially acquiring the pressed fret strings in the pressed fret string sequence, and based on the currently acquired pressed fret string, filling in the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret, until it is detected that the position currently requiring the value to be filled in has been filled in with the value; Generate a new array and initialize the array, and then execute the step of filling the position corresponding to the to-be-pressed string in the current array with the value corresponding to the to-be-pressed fret based on the currently acquired pressed fret string, until all the pressed fret strings in the pressed fret string sequence are traversed; Output multiple arrays as guitar fingering sequences in the order they were generated.
9. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable codes, and when the executable codes are executed by the processor, the processor executes the method for generating a digital human playing animation in real time as described in any one of claims 1 to 6.
10. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable codes, and when the executable codes are executed by a processor of an electronic device, the processor is caused to execute the method for generating a real-time playing animation of a digital human as described in any one of claims 1-6.