7c0h

Articles tagged with "music"

Why the music industry still won't take my money?

Remember this post where I complained that the music industry won't take my money? Well, it's that time of year again.

As you may remember from following me on Mastodon, I bought an Alexa, set it up in Spanish, and almost went insane due to how bad it was. So I did what every normal person would do in this case and I gifted to my mom. This Alexa slept in an Argentinean drawer for a long time, until one day I finally convinced my family to stop worrying about breaking it. Today it works mostly as a voice-activated music player for my nieces.

We have established before that I am an idiot, and because I'm an idiot I decided to set up Spotify (with a family plan) instead of Apple Music. I already have a rocky situation with Spotify, which is why I am not shocked at all to learn that, just like Amazon and Warner before them, Spotify will not take my money:

  • I cannot pay for my mom's plan because my card is German and the account is not. And the device's IP is obviously in Argentina.
  • I cannot use an Argentinean credit card, because I don't have one.
  • I cannot use the other available methods because they require me to physically go to a store in another continent.
  • I cannot pay with a gift card - even suggesting this as a possible feature will get your request closed without review.
  • I can try to set the account to a German one, but as the tech support representative would put it, "you can give it a try, however that is something we are unable to guarantee that will work". Also, I fear this may cause Alexa to start speaking in German, and my mom won't be amused by that.

So once again I am trying to give a company money -- no, scratch that: I am trying to give a company money THAT'S WORTH MORE THAN THE MONEY THEY WANT (Argentinean pesos are not super hot right now), and yet they won't listen to reason. The Spotify forums are full of threads where the best answer you'll get is a "Community Legend" saying that it sucks to be you.

The most likely end of this story is that I'll wire some money over Western Union and one of my relatives will go to a store to pay the bill. My time will be wasted, I'll lose some money in the exchange, my relative's time will be also wasted, and Spotify will receive money in a currency that's devaluating at a 10% monthly rate.

Great job, Spotify.

Brain dump

Here's a list of short thoughts that are too long for a tweet toot but too short for a post.

On old computer hardware

I spent the last month of my life fixing the computers of my family. That meant installing Roblox on a tablet with 1Gb of RAM, fixing antivirus on Windows 7, dealing with Alexa in Spanish, and trying to find cheap ink for printers with DRM. Fun fact: HP uses DRM to forbid you from importing ink, and then stopped delivering ink to my family's city.

Modern hardware can have a long, long life, but this won't happen if software developers don't start optimizing their code even a bit. Sure, Barry Collins may not have a problem with an OS that requires 4Gb of RAM, but I feel I speak for tens of thousands of users when I say that he doesn't know what he's talking about.

On new computer hardware

I know that everyone likes to dump on Mark Zuckerberg, and with good reason: the firm formerly known as Facebook is awful and you should stay away from everything and anything they touch. Having said that, there's a reasonable chance that the moment of VR is finally here. If you are a software developer, I encourage you to at least form an informed opinion before the VR train leaves the station.

On movies

I wasn't expecting to enjoy Ready or not as much as I did. I also wasn't expecting to enjoy a second watch of Inception almost as much as the first time, but those things happened anyway. I was however expecting to enjoy Your name, so no surprises there.

I also got on a discussion about Meat Grinder, a Thai film that is so boring and incoherent that it cured me of bad movies forever. No matter how bad a film is, my brain can always relax and say "sure, it's bad, but at least it's not Meat Grinder". I hold a similar opinion about Funny Games, a movies where even the actors on the poster seem to be ashamed of themselves. At least here I have the backing of cinema critic Mark Kermode, who called it "a really annoying experience". Take that, people from my old blog who said I was the one who didn't "get it".

On books

Michael Lewis' book Liar's Poker is not as good as The Big Short, but if you read the latter without the former you are doing yourself a disservice. I wasn't expecting to become the kind of person who shudders when reading that "the head of mortgage trading at First Boston who helped create the fist CMO, lists it (...) as the most important financial innovation of the 1980s", and yet here we are.

I really, really, really like Roger Zelazny's A night in the lonesome October, which is why I'm surprised at how little I liked his earlier, award-winning book This immortal. I mean, it's not bad, but I wouldn't have tied it with Dune as Hugo Award winner of 1966 for Best Novel. I think it will end up overtaking House of Leaves in the category of books that disappointed me the most.

And finally, I can't make any progress with Katie Hafner and Matthew Lyon's book Where wizards stay up late because every time I try to get back to it I get an irresistible urge to jump onto my computer and start programming. Looks like Masters of Doom will have to keep waiting.

On music

My favorite song that I discovered this year so far is Haunted by Poe. Looking for some music of her I learned about how thoroughly lawyers and the US music industry destroyed her career. This made me pretty angry until I read that her net worth is well into the millions of dollars, so I guess she came out fine after all. And since the album was written as a collaboration with her brother while he was writing "House of Leaves", I guess I did get something out of that book at the end.

Why won't the music industry take my money?

I have tried this week to buy the soundtrack for The Greatest Showman for a gift and let me tell you, it's really hard.

I started naively thinking that, since the album is available on Amazon as MP3, I could just click "Buy" and be done with it. But Amazon, as it turns out, doesn't want my money. Sure, they say they will sell me the album. But once I actually try they reject my credit and debit cards with a mysterious error that, after some digging, may be related to Amazon not having the rights to that album in Germany. I say "may" because Amazon doesn't give me any usable information - all they show is this error:

We were unable to process your purchase with your current payment information. Please enter a valid payment method and an address which are both local.

Seeing that my credit card is valid, my address is local, and the buy page doesn't mention any kind of restrictions, that's my first dead end.

My second stop is Warner Music, who owns the soundtrack. This is also a waste of time: they will gladly sell me physical copies in vinyl, but digital? No luck there.

Next: Apple, the first big company to offer DRM-free music downloads and self-professed champions of user experience. We were off to a rocky start: you can only buy music using iTunes, which is not available in Linux and forces me to boot my Windows 10 PC. One hour later, courtesy of Windows 10 deciding it's a good time for an update, I am faced with this screen:

iTunes screen showing gibberish

If you think this well-known and yet unresolved issue stopped me, you are mistaken - I have signed way too many contracts in languages I don't fully grasp to be afraid of what is clearly a credit card details form. Luckily, after giving my password like 6 times, converting m4a files to mp3, and almost two hours later, I am finally the proud temporary owner of this soundtrack.

So let's talk now about Spotify. I reluctantly started using it again because it's one of the few services with an offline mode for Android phones that doesn't require giving my phone number. Seeing as I still object to their collection of private data, I created a fake profile that I regularly renew with gift cards. But do you know what happens when your subscription is about to run out? The answer is "nothing": you get zero notifications, no e-mail, nothing.

What happens when my subscription runs out? First: all of my offline music is deleted, which is the one feature I'm paying for. Since I'm often in offline mode for work, that means no music for me for the rest of the day. And second: just like there is no notification about my balance running out, there is also no option in the app to give a new gift card code. I can easily give my credit card and subscribe forever, but gift cards require extra steps.

What these two infuriating stories have in common is that they are examples of the music industry working both badly and as intended. Amazon, Spotify, and Apple (up to a point) will gladly give me access to the music I'm trying to pay for, but only if I agree to set recurring payments to their walled gardens and access to my private data. Owning my music and keeping my privacy, however, is really hard.

Which brings me to my final point. There is a service with an extensive, high-quality music catalog that's easy to use, works on every platform, let's you keep your privacy, and will take your money but only if you really want to. It's called piracy. And even though it's been almost 10 years since Gabe Newell publicly pointed out how to effectively get rid of piracy for good, we are somehow still living in a world where buying a single music CD takes two hours, Windows, fluency in fictitious languages, and a computer science degree.

At least you can now order your vinyl records via e-mail. Take that, 1980s!

Music for programming

Like many programmers, I am a night owl. Also, as many other programmers, I have a day job that forces me to be there at 8. These two characteristics interact badly with each other.

For most programmers, this is the type of problem normally solved with coffee. But not being a coffee drinker in general (I think it's just okay) and with what I can only assume is a natural immunity to caffeine, my to-go alternative solution is music: a good pair of headphones and epic, upbeat music makes wonders for my concentration until lunch time, when all productivity dies.

2019 was a great year for me to both catch up with songs I didn't listen to in many years and to discover new ones. The following is a list of songs to which I return every week, divided into three sections: Full albums, Instrumental songs (no words), and Individual songs (with words).

Full albums

There are two full albums that I have often listened entirely during long coding sessions, and that I definitely recommend:

  • For no one's surprise, Daft Punk's soundtrack for TRON: Legacy makes the list. Too bad the rest of the movie was not as good.
  • I haven't seen The Exorcist yet, so I never considered this album "creepy", but if you have seen it then you might recognize the opening of Tubular Bells. I found that the song's rhytm perfectly syncs with my internal rhytm, and it is not unusual for me to realize that I need to take a break right as the album comes to an end.

Instrumental Songs

It has been common knowledge for some time now that movie music is ideal for focusing on a task - you don't want the music to pull you out of a movie, the same way I don't want my music to pull me out of my work. For this reason alone, the first three items in this list are pulled straight out of Hollywood blockbusters:

Moving onto TV, the next two songs are taken from the Japanese series "Kill la Kill": Naming Sense Gata Boshi Gokuseifuku, which I could swear I never heard in the series itself, and Nui Harime's theme.

Finally, and cheating a little bit, the theme from "The Good, the bad, and the ugly" as performed by the Danish National Symphony Orchestra is the one piece of music that got me to actually, physically buy music in many years.

Individual Songs

Individual songs are always tricky, because it takes a lot of listening to them before you learn to ignore the lyrics and let them blend in the background. That said, if you are looking for songs to listen over and over again, here's a bunch:

  • The least controversial song in this list are The greatest show on Earth and Ghost Love Score, both by Nightwish. They have long instrumental-only sections, and they are epic enough to give you an extra push while working.
  • Both Heldenzeit and Guten Tag by the German band "Wir sind Helden" are the perfect example of a great band that you discover long after they have disbanded. If you are a geek, the videoclip for Analogpunk (performed by the singer of "Wir sind Helden") is full of easter eggs.
  • The theme of "Revolutionary Girl Utena", Rinbu Revolution, is really good. There are not that many series where seeing the opening over and over is a plus, but Utena manages it.

Honorable mentions

I feel John Butler's "Ocean" deserves a spot in this list. It didn't make it into the official selection simply because I couldn't decide which version to include. I'm partial to the live version because it's the first one I heard, but the 2012 studio version is not bad at all.

A more polite Taylor Swift with NLP and word vectors

My relation with Taylor Swift is complicated: I don't hate her — in fact, she seems like a very nice person. But I definitely hate her songs: her public persona always comes up to me as entitled, abusive, and/or an unpleasant person overall. But what if she didn't have to be? What if we could take her songs and make them more polite? What would that be like?

In today's post we will use the power of science to answer this question. In particular, the power of Natural Language Processing (NLP) and word embeddings.

The first step is deciding on a way to model songs. We will reach into our NLP toolbox and take out Distributional semantics, a research area that investigates whether words that show up in similar contexts also have similar meanings. This research introduced the idea that once you treat a word like a number (a vector, to be precise, called the embedding of the word), you can apply regular math operations to it and obtain results that make sense. The classical example is a result shown in this paper, where Mikolov and his team managed to represent words in such a way that the result of the operation King - man + woman ended up being very close to Queen.

The picture below shows an example. If we apply this technique to all the Sherlock Holmes novels, we can see that the names of the main characters are placed in a way that intuitively makes sense if you also plot the locations for "good", "neutral", and "evil" as I've done. Mycroft, Sherlock Holmes' brother, barely cares about anything and therefore is neutral; Sherlock, on the other hand, is much "gooder" than his brother. Watson and his wife Mary are the least morally-corrupt characters, while the criminals end up together in their own corner. "Holmes" is an interesting case: the few sentences where people refer to the detective by saying just "Sherlock" are friendly scenes, while the scenes where they call him "Mr. Holmes" are usually tense, serious, or may even refer to his brother. As a result, the world "Sherlock" ends up with a positive connotation that "Holmes" doesn't have.

Embeddings for characters in the
Sherlock Holmes novels

This technique is implemented by word2vec, a series of models that receive documents as input and turn their words into vectors. For this project, I've chosen the gensim Python library. This library does not only implement word2vec but also doc2vec, a model that will do all the heavy-lifting for us when it comes to turn a list of words into a song.

This model needs data to be trained, and here our choices are a bit limited. The biggest corpus of publicly available lyrics right now is (probably) the musiXmatch Dataset, a dataset containing information for 327K+ songs. Unfortunately, and thanks to copyright laws, working with this dataset is complicated. Therefore, our next best bet is this corpus of 55K+ songs in English, which is much easier to get and work with.

The next steps are more or less standard: for each song we take their words, convert them into vectors, and define a "song" as a special word whose meaning is a combination of its individual words. But once we have that, we can start performing some tests. The following code does all of this, and then asks an important question: what would happen if we took Aerosmith's song Amazing, removed the amazing part, and chose the song that's most similar to the result?


import csv
import gzip
from gensim.models import Doc2Vec
from gensim.models.doc2vec import TaggedDocument

documents = []
with gzip.open('songlyrics.zip', 'r') as f:
    csv_reader = csv.DictReader(f)
    counter = 0
    # Read the lyrics, turn them into documents,
    # and pre-process the words
    for row in csv_reader:
        words = simple_preprocess(row['text'])
        doc = TaggedDocument(words, ['SONG_{}'.format(counter)})
        documents.append(doc)
        counter += 1

# Train a Doc2Vec model
model = Doc2Vec(documents, size=150, window=10, min_count=2, workers=10)
model.train(document, total_examples=len(documents), epochs=10)

# Apply some simple math to a song, and obtain a list of the 10
# most similar songs to the result.
# In our lyrics database, song 22993 is "Amazing", by Aerosmith
song = model['SONG_22993']
query_vector = song - model['amazing']
for song, vector in model.docvecs.most_similar([query_vector]):
    print(song)

One would expect that Amazing minus amazing would be... well, boring. And you would be right! Predictably, when we do exactly that we end up with...

  • ...Margarita, a song about a man who meets a woman in a bar and cooks soup with her.
  • ...Alligator, a song about an alligator lying by the river.
  • ...Pony Express, a song about a mailman delivering mail.

We can use this same model to answer all kind of important questions I didn't know I had:

  • Have you ever wondered what would be "amazingly lame"? I can tell you! Amazing + lame = History in the making, a song where a rapper tells us how much money he has.
  • Don't you think sometimes "I like We are the World, but I wish it had more violence?". If so, Blood on the World's hands is the song for you.
  • What if we take Roxette's You don't understand me and add understanding to it? As it turns out, we end up with It's you, a song where a man breaks up with his wife/girlfriend because he can't be the man she's looking for. I guess he does understand her now but still: dude, harsh.
  • On the topic of hypotheticals: if we take John Lennon's Imagine and we take away the imagination, all that's left is George Gershwin's Strike up the band, a song about nothing but having "fun, fun, fun". On the other hand, if we added even more imagination we end up with Just my imagination, dreaming all day of a person who doesn't even know us.

This is all very nice, but what about our original question: what if we took Taylor Swift's songs and removed all the meanness? We can start with her Grammy-winning songs, and the results are actually amazing: the song that best captures the essence of Mean minus the meanness is Blues is my middle name, going from a song where a woman swears vengeance to a song where a man quietly laments his life and hopes that one day things will come his way. Adding politeness to We are never coming back together results in Everybody knows, a song where a man lets a woman know he's breaking up with her in a very calm and poetic way. The change is even more apparent when the bitter Christmases when you were mine turns into the (slightly too) sweet memories of Christmas brought by Something about December.

Finally, and on the other side, White Horse works better with the anger in. While this song is about a woman enraged at a man who let her down, taking the meanness out results in the hopeless laments of Yesterday's Hymn.

So there you have it. I hope it's clear that these are completely accurate results, that everything I've done here is perfectly scientific, and that any kind of criticism from Ms. Swift's fans can be safely disregarded. But on a more serious note: I hope it's clear that this is only the tip of the iceberg, and that you can take the ideas I've presented here in many cool directions. Need a hand? Let me know!

Further reading