Digital Cut Up

To me, all pop music sounds kind of the same.  Simple lyrics, usually about love or sex or partying or something, are a staple of what amounts to songs that are supposed to be incredibly identifiable, not challenging, and usually just plain fun.  Me, being the grinch that I am, have a hard time listening to most pop music, as the truly popular pop music’s vapidity wears on me.  There’s definitely some pop music I like, but I tend to find most of it just irritating.  /rant.

So, in my attempt to justify my dislike for this music staple I wanted to see how similar the top songs really are.  I could do this by mashing the lyrics together.  If what I got was kind of the same as the original songs, then I’ve proved my point, which is obviously a deeply important point to make to no one but myself.

The program is simple. Read in the lyrics from the top Billboard pop songs from 2015.  Turns out there were 9 songs that held the top of the charts for the year (each of which I created a plain text file for and copied the contents in).  The program reads in all lines from all songs, then randomly grabs a lines.  To keep a sort of song structure, I tried to make stanzas of 4 lines each, with a break in between.  Here’s the program:

import sys
import glob
import random

# read in all files
# print sys.argv

# read all text files of type .txt at this location
path = '/Users/jamiecharry/Documents/School/ITP/Classes/readingAndWritingText/homework2/sourcetexts/*.txt'
filenames = glob.glob(path)

# Load all songs
songs = []
for name in filenames:
    with open(name) as f:
        song = f.readlines()

all_lines = []
for song in songs:
    for line in song:
        line = line.strip()
        if len(line) != 0:

counter = 0
for line in range(0,28):
    randIndex = random.randint(0,len(all_lines)-1)

    # after 4 lines, print a newline character
    if counter % 5 == 0 and counter != 0:
        print ''
        print all_lines[randIndex]
    counter += 1

Glob was a pretty neat module that let me create an array of all the filenames of any text file in a particular directory. Using that array, I could load each song one at a time. I then dumped all the lines from each song into a single massive array.

With that in place, I then printed out randomly grabbed lines using a random integer. A simple check to ensure I would get line breaks every so often and voila. Program is in place. Now for the results.

My favorite output of the bunch:

But you'll come back each time you leave
Better make up your mind
Then the line will never be crossed
The love will never get lost (and the love will never get lost)
It's been a long day without you, my friend

What do you mean?
Oh I think that I found myself a cheerleader
It's been a long day without you, my friend

Do you need me
'Cause, darling, I'm a nightmare dressed like a daydream
Oh I think that I found myself a cheerleader
There's such a difference between us

Doh doh doh, doh doh doh, doh doh (Hah!)
So take a look what you've done (look what you've done)
And, baby, now we got bad blood

Screaming, crying, perfect storms
You gotta know how to
Hey, hey, hey, oh!

And I don't think we can solve them
Wait, the worst is yet to come, oh no


And my second favorite:

What do you mean?
You made a really deep cut
And you love the game
Found out I was coming, sent your friends home
All these other girls are tempting but I'm empty when you're gone

To tell you I'm sorry for everything that I've done
I only love it when you touch me, not feel me
I can't find your house, send me the info
Your man on the road, he doing promo

You're the only girl for me
Hey, hey, hey, oh!
I just fucked two bitches 'fore I saw you
'Cause you know I love the players

The only time that I'll be by your side
And that line is what we reach
And I'll write your name
They'll tell you I'm insane

Uptown Funk you up, Uptown Funk you up (say whaa?!)
Jump on it
But I've got a blank space, baby
I'm in California dreaming about who we used to be

Doh doh doh, doh doh doh, doh doh (Hah!)
Doh doh doh, doh doh doh, doh doh (Hah!)

Leave a Reply

Your email address will not be published. Required fields are marked *