1 Introduction
In writing this generation, I am still in trouble should be the first to write the lyrics parsing, or write lyrics generation, and then I think, in fact, it is necessary to first have lyrics file, only to parse it, of course, we can also through the existing lyrics (KRC, TRC and KSC, etc.) directly skip this step, directly parse lyrics can.
2 Making Software
Here to introduce the "Little grizzly Bear Karaoke subtitle Production Software", we can through a number of professional production software, to clarify the stir understand the production principle of lyrics. Here first:
With the use of the graph and software to create lyrics, we can know the following information:
1. Lyrics in the production of units, by "word" production
2. In the production of lyrics, the software seems to have each line of lyrics "word" is divided, it should be for the convenience of making lyrics, so pre-line lyrics into each "word", where the "word" includes: English words, numbers string, Chinese, where the space "can only" with English words, numbers string or Chinese form a " Word ", and the position of the space to be placed in the back
3. In the process of making lyrics, the music sounded, heard line lyrics in the "word", click on the "Space", here Click "Space", in fact, it should be recorded "word (a)" Occurrence time, when the next "word (B)" or change lines, then you can record "word (a)" of the duration
4. Lyrics Wrap, record line lyrics start time
5. When the lyrics are finished, the corresponding lyrics files are generated according to the lyrics format.
Note: 2nd and 3rd are the key to making lyrics, and if you can't understand them, you won't be able to make lyrics.
3 self-made software
Know the principle of making lyrics, we have to write and implement their own production lyrics software, here I use Java Swing to write a desktop program, the interface to reference the cool dog implementation.
3.1API
Java Swing:Graphics2D.setClip. Of course, there are Android, the blog will be said later.
From the figure, graphics2d in the painting text, first draw the default color of the lyrics text, and then set the length of the clip layer width, and then paint the "highlight" lyrics text, as long as we constantly modify the width of the clip layer, we want the dynamic lyrics effect. Of course, when we are making lyrics, we just need to set the gradient increment width to the width of each "word".
3.2 Entity class design 3.2.1 Lyrics entity, line lyrics entity, label entity
Using the "talking about dynamic lyrics-lyrics analysis" In the entity class, when making lyrics, the resulting data will be saved to the lyrics entity (Lyricsinfo) inside, convenient lyrics preview and generation.
3.2.2 Lyrics File Generator
The function of this class is to facilitate the development of a variety of dynamic lyrics format.
3.2.3HRCX Lyrics Generator
3.3 Interface 3.3.1 Input lyrics
3.3.2 Making lyrics
Ideas:
1. It is probably the "input lyrics" lyrics Text, line segmentation
2. After the line lyrics, the lyrics of the content of the analysis, and "word" segmentation
3. Play songs, press "left and right arrows" and "spaces" to make lyrics
4. Split part of the code:
5. Interface
Note: purple, is completed. Red, indicating that the build is in progress.
3.3.3 Production completed
3.4 Lyrics Generation
Section code, file suffix name: HRCX
3.5 Lyrics Effect Preview
4 references
Karaoke Lyrics Implementation
Note: This is like an Android video tutorial, and I am also looking at the Java Swing API from the principle of this video.
5 Source code
Lele Music
Note: This is a PC music player I wrote with Java swing.
6 Last
In the next article, we will introduce the analysis of dynamic lyrics. If there is infringement, please inform.
On dynamic lyrics-lyrics generation