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 (firstname.lastname@example.org), where I post a song every Monday, with a short explanation of something interesting to notice when you listen to it.
Aug 13, 2018
If you have been following this blog for a long time, you might know that I’m a big fan of the suffragettes, the English radical suffragists led by Emmeline Pankhurst. I’m also obsessed with role-playing games, stories in general, and I like designing and making. You don’t have to be a genius to guess that I have made a story game about the suffragettes! It’s the first game I ever make.
The game is called Deeds, not Words, after their motto, and it’s a simple game for three players. It doesn’t need a narrator or Game Master, and it needs no preparation. It should last for 2-3 hours.
The idea behind it is to create three characters (three suffragettes) and come up with scenes of their daily life, or their work as activists for the women’s suffrage. The story is divided into 12 chapters in which the characters train and become better at different things, bond with each other, and fight against their opponents: the police, unjust laws, organisations that oppose the women’s suffrage, etc.
The game focuses on balance (the fight for women’s suffrage consisted of physical confrontations, stunts to outsmart the police with diversions and disguises, and effective communication; all this is reflected in the game) and collaboration. The mechanics should probably work well with any kind of activist group, but my version focuses on the suffragettes.
You can download Deeds, not Words from my story game website Hardcore Narrativist. And if you need any inspiration or want to learn more about the suffragettes, I recommend the excellent, freely available documentary No Man Shall Protect Us.
Jul 31, 2018
For a tiny project of mine (that I’ll publish once it’s ready) I needed to write a short document, and I used LibreOffice.org, as always. I wanted a fancy, old fashioned font for the document, so I headed for Font Squirrel and found a font I liked, Elsie. When I had written several paragraphs I realised that there was a ligature (“fi”) that didn’t display correctly. I really liked the font and I didn’t want to change it, but I couldn’t really use it as-is. So I started looking for ways to disable certain ligatures, or at least ligatures in general.
Disabling ligatures in LibreOffice.org
Looking around on the internet (mostly Stack Overflow) it seemed that at least modern versions of LibreOffice.org, with at least certain types of fonts, could disable at least certain ligatures. Or ligatures in general. Or something.
It wasn’t very clear to me at first, but after digging a bit I saw that fonts define certain “flags” that you can turn on and off. And how do you do so? Through a very ugly hack: you can ask LibreOffice.org to use a font like “
Elsie:-liga”, and that’s interpreted as using the
Elsiefont but disabling the
ligaflag. Unfortunately, in this case there’s no granularity in the ligatures in this font, so I couldn’t disable just the “fi” ligature. In this case it wasn’t a big deal because the other ligatures were a bit over the top for the body text anyway. As I didn’t have any “fi” in the titles, I’ve left the full font plus all ligatures for the titles.
Finding out the tags for a given font
Now, how do you know which flags are available in a given (OpenType) font? Under Linux you have a collection of utilities called
lcdf-typetoolswhich includes a utility called
otfinfo. You can read more in How the OpenType font system works, the article where I found this information.
In this case, the output of the tool was:
$ otfinfo -f elsie/Elsie-Regular.otf liga Standard Ligatures salt Stylistic Alternates
In this case one can guess that there’s no way to disable just the “fi” ligature, and I just had to use the
Elsie:-ligato get rid of all of the ligatures. I could have marked the parts with “fi” and remove ligatures only there, but I thought it wasn’t worth it.
Installing a newer LibreOffice.org
Also, all this only works under LibreOffice.org >= 5.3. Unfortunately, my version was older so the trick didn’t work. However, I have the fantastic Flatpak installed for these cases, so it’s easy to install random versions of random programs without messing with the base packages of the operating system or adding new eg. APT sources. So I went to Flathub and found a recent enough version of LibreOffice.org.
It’s possible to tweak certain characteristics of an OpenType font under LibreOffice.org >= 5.3 through a really ugly hack with the font names. These names can of course be used in styles, so one can define the “Body text” style to use eg.
Elsie:-ligainstead of simply
Elsieto remove ligatures from the body text. For more information about OpenType fonts under Linux, read the article How the OpenType font system works.
Jul 1, 2018
I had to buy a new phone recently for reasons. I decided to stay on Android partly because of the apps I’m already using and depending on. Many of them I install from F-Droid, and AFAIK most are only available there. As F-Droid is not available on the Google Play Store, an initial “bootstrapping” is needed. Typically, you download the
.apkfile from the F-Droid site and install from the file manager.
However, there was apparently no way to install the
.apkfile from the file manager that came with the phone, so I didn’t know what to do. I looked for the relevant options trying to find the right switch to make it possible, but I didn’t find anything. I tried to look for solutions on the internet but again nothing. After several attempts I figured there must be some application on the Google Play Store that would allow you to install
.apkfiles, and I was right. The problem was, all applications I could see were full of ads and I’m guessing they would leak a lot of information about the phone and its user.
After a while, though, I found one that seemed to do what I wanted without displaying ads and (hopefully) not spying on you. It’s called App Installer and it’s made by a certain Eugen C. It was simple to use (it just finds all
.apks you have downloaded and presents them so you can choose which one to install) and it worked like a charm. After that I could finally start installing the applications I wanted from the F-Droid store.
Jun 25, 2018
Last Sunday I went to Arcon, a gaming convention in Oslo. There are many types of games being played, but I only care about story games. This year I didn’t win the scenario award, but I had a lot of fun! I had three different sessions, all the same day:
- A demo of Black Wolf, my rules to play in dark fantasy settings.
- A game of Ribbon Drive.
- A game set in Michael Moorcock’s Young Kingdoms, using the Black Wolf rules and my scenario “Ilmioran Dream”.
For the first one no one had signed up so I assumed no one would come. However, I showed up and waited for a bit, and a person came! We had a very nice conversation about the system, design decisions, and he gave me a couple of ideas. So, much better than I expected.
The second one went pretty well, too. Six people came so we split into two tables. As one of the attendees had played before, we decided to be one in each table so I didn’t have to check the other one from time to time. That means that I got to play, not just “facilitate” the game!
The third one was the long session (5 hours). It was narrating “Ilmioran Dream”, a scenario I had written about racism and power plays, using the Black Wolf rules. Only three players ended up playing (out of four characters in the story) but it was really fun! I think the players liked both the story and the system, so I cannot complain.
All in all, a very intense and fun day.
Jun 25, 2018
Last Friday I gave a talk about “Listening to music”. It all started after a conversation in which I was trying (and failing) to explain what the “progressive” label meant in “progressive rock” and “progressive metal”. I figured the only way was to show the same piece of music with simpler and more complex arrangements. This is the blog post version of that talk.
The idea of the talk was twofold: first, give a better idea of the possible differences between a straightforward rock song and a more complex rock song. Second, to show examples of musical decisions that make a song sound different, so it’s easier to spot why we like the music we like. It was never my intention to suggest that more complex music is better (everything has its uses), just to see that songs sound like they do because of a number of decisions made when writing and recording it.
Through the talk, we take the chorus of a song and rewrite it to be a simple as possible, and then we make changes until we’re back to the original.
This is the original version of the song (just the chorus, really). It’s not quite progressive rock, but it certainly has similar elements:
Now, we are going to rewrite it to sound as straightforward as possible.
This is a completely rearranged version of the same chorus, in the most straightforward way that still sounded like a song someone could write:
Compared to the original, this should sound much more familiar, safe, and stable. Many things have been changed to reach this version. In the following sections we’ll undo those changes one by one and we will end up with the original version.
First change: chords
The straightforward version uses “power chords”, which are simplified chords used often in rock, punk, and metal. I prefer full chords, so the first change is just that:
The difference can be quite subtle, especially with this computer version. You can compare just the guitar in one and the other here:OLDNEW
Second change: bass line
If you pay attention to the song as is stands now, the bass is simply repeating the root note of each chord being played. The result is that the bass “supports” the guitar, making the sound of the chords fuller, but not much more. Instead, let’s make a more playful bass line, using some of the available notes in the chord (instead of always the root):
The only difference is the bass. Compare the old bass line to the new one:OLDNEW
Third change: rhythm
The next step is to change the rhythm. The common rhythm most pop and rock is built upon is 4/4, but I’m fond of 6/8 (a rhythm that sounds somewhat like waltz, and it’s often used in ballads). This difference is somewhat big because all instruments have to adapt:
Compare to the version in 4/4:
🛈 Example of song in 6/8: Somebody to love by Queen.
Fourth change: strumming
The first version in 6/8 has a very simple groove: it simply marks the chords being played and little else. Hence, we’ll change the guitar to have a nicer groove. The bass rhythm will be a variation on that, but while at it we’ll also changes the notes. Thus, both guitar and bass change:OLDNEWOLDNEW
Fifth change: drums and small details
In the previous version, the drums play a very straightforward 6/8 groove. I wanted something different for this song because I was going for an unstable, dark sound. So the drums had to change. This is, finally, the original version (same as at the top of this post):OLDNEW
🛈 Example of song with drums going against a 6/8 groove: Judith by A Perfect Circle, from 3:12 to 3:16 approx.
Apart from the drums themselves, the guitar also changes slightly in the second half of each line (between 6 and 8 seconds in). Compare the two:OLDNEW
🛈 Example of song with a sort of call-response between voice and guitar: Jeremy by Pearl Jam, at around 1:19.
As it’s hopefully clear by these examples, somewhat small changes can make a big difference in the feel of a song. When we stack several of those changes we can make a song sound very, very different.
And remember, complexity is not necessarily good! In this song I needed that unstable sound, but don’t get blinded by the fascination of complexity.
Oct 5, 2017
Inspired by similar articles I have read, I decided to give my two cents on writing scenarios for role-playing games. While I’m far from being an expert in the matter, let alone a half-decent writer, I have written several scenarios that seem to have clicked with some people. These are my principles when writing story-centric scenarios (beware spoilers of most of my scenarios, don’t read if you intend to play them!):
Remember the story is not linear: don’t write as if you were writing a short story. In a way, writing a scenario is writing down your (obsessively detailed) research for a short story. Focus on the mood, possible scenes, characters, general plot, and clues, and improvise the story from there. Example: Gone Girls has a list of characters and possible scenes and locations, but no order is implied, or even that all scenes will happen. Characters are described with their goals and knowledge, and several possible endings are described for reference.
Have a theme/topic for the story: something like family, prejudices, the cost of freedom, or loyalty. A story theme will help you focus while writing, and it will give the scenario a certain consistency. It will also give you ideas for possible scenes or for plot elements, when used literally or metaphorically. And don’t worry if you think the players won’t catch the metaphors: they still give the scenario a certain feel and focus. Example: Suffragettes is about class warfare from a feminist point of view. One of the metaphors is that the protagonists are fighting the patriarchy. And thus, the antagonists are middle- to high-class people who worship a deity they call “Father”, based on Father Dagon.
Know the important NPCs well enough: you should know how your NPCs (non-player characters; anyone who isn’t the protagonists) will react to different situations. It helps to write down a couple of likely situations. Example: Suffragettes (page 5) has a relatively in-depth description of what Florence knows and how she will react in different situations.
Make/get maps of the most important locations: they are handy for consistency, especially if it’s possible there will be an action scene in them. Example: The Cultists has a full map of the prison, even if the players are very unlikely to see it all.
Make a timeline of events: if there are certain things that will happen regardless of what the characters do, make a timeline. Example: Gone Girls has a timeline of events both leading to the beginning of the story, and happening as the story develops.
Treat the scenario as resources and ideas when improvising: in the end, you will have to make up a bunch of the stuff on the spot, and also it’s satisfying to change or make up new elements to adapt the story to whatever the players found interesting, or to incorporate ideas the players give you as the story develops. Example: once, when telling Gone Girls, the idea of making Edward Clarke invincible came up, along with the idea of making him being able to manipulate opponents to the extent of making them kill themselves. This was never part of the original story but made sense that one time and made the ending more dramatic.
Show, don’t tell! Instead of telling the players about certain important things (eg. some character is a racist, some character is lazy, a room is a mess), setup a situation to make that point. Not only is more memorable, but it gives nuance and extra information. Saying “Tom is lazy” is generic and vague, but seeing how Tom still has boxes from when he moved in, a mess of cables all over the floor, and a pile of dirty dishes in the sink, says just how lazy he is, and in which situations. Example: in Suffragettes (page 9), Elise Samson is not simply described as “poor” or “homeless”. Instead, there’s a short sequence in which this is explained through a situation.
And that’s it! I hope you find this list useful. As a bonus tip, if you are writing horror (interactive or not) I recommend you read my summary of the book “Writing Monsters”, and maybe read the actual book, too.
Jun 27, 2017
Finally Arcon is over and I can publish my latest scenario. Luckily, it was one of the three winners (second place) and I bought Fiasco companion with my gift card. It had nine players, which we split into three groups that played simultaneously thanks to the help of two extra narrators.
The scenario is called “The Cultists” and it’s a Lovecraftian horror story about a group of Christians that know each other from church, and are captured by a group of cultists. They are put in what seems to be an abandoned jail, together with 20 or so more prisoners. The protagonists have no idea why they are kept there, or what the cultists want or intend to do. As days pass, more and more gruesome things happen to the prisoners. The main themes of the scenario are truth, and whether it’s useful to be right if you live with people who are wrong and cannot be convinced otherwise. It’s written for Call of Cthulhu but it almost doesn’t depend on any rules so you can play it with whatever system you like. As most of my material, it’s written for adult players.
This scenario completes what I jokingly refer to as the “SJW trilogy”, a collection of three horror scenarios related to social issues: “Gone Girls” (about racism and prejudices), “Suffragettes” (about class warfare, esp. in the context of feminism) and “The Cultists” (about having “crazy” people in power). As always, you have them available in the scenario section of my RPG resources page.
Edit: update links to point to HardcoreNarrativist.org.
Jun 7, 2017
It hasn’t quite been one year since I wrote the first post on Elm, but it’s not that far off and the title was clearer that way. In this time I have written three programs in Elm, each one more complex than the last:
NARROWS, a storytelling system halfway between online role-playing games and improvised Choose Your Own Adventure books.
What I like about Elm
It’s a simple language with few concepts, easy to learn and understand. After my initial (small) struggles, I have mostly loved it since.
The Elm Architecture is really nice and simple, and it’s nice that it’s integrated into the environment. It’s like having a framework for free with the language.
Everything immutable: the easy way is the right way.
Nice, clear, useful compiler error messages.
Generally nice toolchain.
Static types help you a lot, mostly without being annoying.
Newer major versions of the language simplify things further and make things clearer and less error prone (I’ve been through two major updates).
What I don’t like about Elm
The compiler seems slow and often seems to compile older versions of the code. This might be my own fault, as I have a custom Brunch configuration with an Elm plugin and I don’t even understand Brunch all that well. In comparison, the TypeScript compiler was amazing.
Newer major versions of the language break compatibility and you have to rewrite parts of your application, which is really annoying… but also worth it.
I’m not that fond of currying. Sometimes I feel like it makes some compilation error messages harder to understand.
I’m really happy I gave Elm a try almost a year ago. Although I’m looking forward to going back to ClojureScript for some project, I really, really enjoy Elm, and it has almost become my defacto front-end language/framework.
subscribe via RSS