Posts Tagged “creative”
Jan 15, 2019
For some time now I had wanted to find a way to create lyric videos without much effort. I really didn’t want a custom video per song, with hand-made everything. Just an easy way to call some scripts and do some tweaks by hand, and get a lyric video.
My first attempts with ImageMagick and animated GIFs didn’t quite work out because the animated GIFs, at least when converted to a video (to add the audio track) didn’t really keep the timing they were supposed to. So I was about to give up, but Luka gave me a very good idea: to make subtitles out of the lyrics, and the use
ffmpegto burn the subtitles into the video itself. So I got to work.
Note: This whole process is absolutely for nerds, as it involves the command-line, Linux, and some hand-made scripts and tweaks in Aegisub, the subtitling program I used. If you’re looking for an easy way to do it with a graphical or web program, you’re out of luck (there might be ways, but this is certainly not it).
Preparing the subtitles
The first step is to create the subtitles for the lyrics. Astonishingly, I start with a simplified text file (in a made-up format), then convert with a hand-made script into an
.srtfile… then I convert it to the final
.assformat in Aegisub. So, yes, the lyrics go through three different formats in total.
The first, made-up lyric format looks like this:
00:52,500 Another gal asked him to please everyone 00:55,000 what an impossible burden to bear 00:59,000 01:09,000 Bunch of Satan suckers 01:11,500 Selling cola products 01:14,500 Are you Christians? Please forgive me 01:17,500 If you didn't like what I said
As you can probably see, it’s a very compact format that can be written easily in a text editor. The idea is that each line stays until the next one, hence I add an empty line with a timestamp (the third line) to make the previous lyric show for 4 seconds, instead of 14. With a hand-made script I convert this format to an
.srtfile, by calling it like so:
./lyrics-to-srt.sh melvin.txt >melvin.srt
Now you might be wondering: why don’t you convert them directly into the final format? The reason is that the
.assformat is a bit more involved, and it contains formatting information, too, like the font used, font size, position of the subtitle lines, etc. It was easier for me to convert to
.srtfirst, do the visual stuff in Aegisub, and save the file as
So how does that work, exactly? Aegisub has a “Styles Manager” (available from the menu “Subtitle”) in which you can define a subtitle style. In it you define the font and other things. You define that once, and that style will be available for you in any file you open with Aegisub. So once I have the subtitles in
.srt(a format that Aegisub can open), I open the file there, select all subtitle lines with Ctrl-A, then choose the style I want in the UI:
After clicking on the style, all lines get marked as having that style, as you can see here (notice the change in the “Style” column, to the left of the lyric text itself):
Now I can choose “Save as…” and save the file as eg.
Preparing the background video
Once I get the subtitles in the appropriate format, I can make the base video (without lyrics) in Kdenlive. The process is as follows:
- I load the song with “Add Clip” on the left hand pane.
- I click “Add Title Clip” on the left hand pane, and I put whatever static text or images I want for the background, including the name of the song.
- I add both to “Audio 1” and “Video 1” respectively, and make sure that the title clip is as long as the audio track.
- I render it to an MP4 video file.
This will give me a video file that has the title of the song and whatever background I want, but no lyrics or subtitles.
Putting it all together
At this point I have two things: the final subtitles in
.assformat, and the basic video without the lyrics. With this, I can use
ffmpegto produce a second video with the subtitles already on it, in whatever font, size, and position I chose in Aegisub. The magic command is this:
ffmpeg -i background-melvin.mp4 -vf ass=melvin.ass melvin.avi
The result will be a video with the subtitles rendered on it, like the Melvin lyric video you can see on YouTube.
Although it does involve several steps and it’s pretty dirty, this method to create the videos is good enough for me. I wasn’t going to create that many (only four in this batch) and I’m comfortable using these tools.
It should be possible to simplify the workflow by typing the subtitles directly in Aegisub, instead of in a text file, then convert them. I might do exactly that the next time I have to make another batch of these, but this time I already had the lyrics in the first format (due to my previous attempts with ImageMagick) so I figured I’d convert them to be able to open them in Aegisub instead of typing them there again. I hope this post was useful!
Oct 13, 2018
About a week ago an idea for a new song popped in my head. I started writing and came up with a verse pretty quickly, and the chorus followed shortly afterwards. As I love talking about music and creative processes and such, and I’m never sure how I write songs when people ask me about it, I decided to take notes about this last one, and explain how I did it. This is by no means the only way to do it. Or, for that matter, the only way I do it.
This should be easy to understand even if you don’t know music theory, as I don’t really use a whole lot when I write (I don’t know all that much myself, anyway). Also, I’ll try to explain the concepts I do use.
The spark for this song was a title and a topic. The title was “Who are you?” and the topic was the feeling of not knowing someone anymore after they change or we discover something about them we didn’t know.
Just minutes after the spark came, a melody popped in my head. Note that I wasn’t thinking about any scales or chords or anything like that. A melody popped in my head and I just needed to write it down before I forgot it.
The first thing I did was to figure out in which time signature the melody was (it’s in 6/8). A bit more on that below if you don’t know music theory. Once I found out it’s in 6/8, I went to http://music-explorer.org and found the notes for the melody, then wrote down the following (at the time I couldn’t notate it properly):
1 2 3 4 5 6 A E A B 1 2 3 4 5 6 1 2 3 4 5 6 B A B C 1 2 3 4 5 6 B A A E
This is a simple visual representation of the melody. The letters are notes, and the numbers are used to count the beat. This is how it sounds:
If you don’t know music theory
If you have no idea what the 6/8 above means, listen to the drums and see how you can count together with the drums, in groups of 6. You should be able to count four groups of 6, and each group should feel like a short phrase, as in it makes sense as a group. If you tried to count in, say, 4, each group of 4 would be random notes, and wouldn’t naturally follow the music.
Look at my made-up graphical representation while you listen to the music and see if you can make sense of it. See how in the last group of 6, the second and fourth notes are not aligned exactly with a number! That happens in the music, too.
If you don’t know music theory: what are chords?
A chord is three (or more) notes played at the same time. Often, one starts with a melody and then adds chords to it. The chords have to have common notes with the melody they accompany.
If you want to try some things, go to http://music-explorer.org, type the chord into the “Highlight chord” box, and press Enter.
If you do know music theory
For some songs I try to write more intuitively, more “from the gut”. This is one of those. In these cases I don’t try to find the key or the scale I’m using, and I don’t think of which chord is the I, or the iii, or whatever. I just try several things until I find something I like.
Adding chords to the verse
As we can see in the visual representation I made, the first notes are A, E, and B. Now, which chords contain at least some of those notes? I tried a couple, and I decided that I liked Aadd9 (which is made of the notes A, B, C#, and E). Because the second bar (the second measure for you Americans; if you don’t know music theory, I mean the second group of 6 beats) doesn’t have any notes, I kept the chord.
For the third bar I liked how Cmaj7 (which is made of the notes C, E, G, and B) sounded. That matches B and C, but not A. That’s fine. For the last bar I only matched E because I went with Cadd11 (I had the impression that I’d like the chord to be another kind of C, and I liked how Cadd11 sounded there; Cadd11 is made of the notes C, E, F, and G).
This is the end result, playing the chords once in the beginning of each bar:
Rhythm and groove
The rhythm of the guitar and the drums was just a placeholder. I wanted the rhythm to be a bit more sophisticated than that. Long story short, after playing a bit with it I ended up with this version:
If you listen closely you’ll hear that in the last bar I added a variant of the Cadd11: it’s Cadd11/E.
Adding a bass line
After I got the guitar chords, I added a bass line. For each bar we know the chord being played, and we know which notes it contains. So, the bass plays one or more notes from the chord (could be the melody, too, but I usually pick from the chord notes).
The first two bars have Aadd9, and in this case I kept it simple and only played A (the root note, ie. the one that gives the chord its name). In the third, the chord is Cmaj7 and I decided to play C, again the root. In the last, the chord is Cadd11, and I decided to play F and E (the 11th and the major 3rd respectively).
Note how the melody, guitar, and bass don’t always play at the same time. Instead, they “weave” the song together.
For the chorus I did something similar: started with the melody, added some chords I liked (by looking at the notes in the melody), then decided the rhythm for the guitar and the drums, and finally I added a bass line. I don’t always work in this order, but it worked for me for this song.
I ended up with the chords Cm7 (comprised of C, D#, G, and A#), C#maj7 (comprised of C#, E#, G#, and C), and Am (comprised of A, C, and E).
Final version (verse + chorus)
This is not the whole song because I’m going to add something more: most likely some kind of outro, a bridge, or maybe space for a guitar solo. But the final version of verse and chorus plus the repetitions I expect to have in the final version are here:
I hope this was useful and easy enough to understand! If you have questions, you can contact me on Mastodon (email@example.com), where I post a song every Monday, with a short explanation of something interesting to notice when you listen to it.
May 20, 2008
Nine Inch Nails released their new album, The Slip, under a Creative Commons license. You are actually encouraged to “remix it share it with your friends, post it on your blog, play it on your podcast, give it to strangers, etc.”. After reading that, I couldn’t resist giving away my e-mail address to download it. There is an MP3 version and two FLAC versions, including a very high quality one.
Kudos to them. I just listened to the album for the first time, I will probably like it when I can make an informed opinion. At least the first impression was better than with Year Zero.