Calculating How Far James Murphy Walks in How Do You Sleep

LCD Soundsystem’s How Do You Sleep is a song about James Murphy walking erratically on a beach. He repeats the lines

One step forward

and six steps back

and I got curious to see if he actually walked into the ocean or inland, away from the water. While the actual song itself is over 9 minutes long there aren’t many lyrics, so I pulled the them into a text file and wrote a little script to plot his journey. The code is actually shorter than the song.

How do you sleep

Standing on the shore, facing east
I can't feel you

Standing on the shore, facing east
Your impermanence
You're taking water
Listing lazily out of view

I remember when we were friends
I remember calling you friend

Standing on the shore my ear aimed east
I can't hear you
I can't hear you anymore
I can't hear you
I can't hear you anymore

I still remember
Laughing and fighting
I still remember

Standing on the shore, watching for you
You're painted into a corner
Whatever fits in your pockets; you'll get your due
Just like before
With all the others
You warned me about the cocaine
Then dove straight in
Yeah, you warned me about the cocaine
Then dove straight in

In hiding, where there's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
There's more for you
Standing on the shore, getting old
You left me here
Amid the vape clouds

I must admit, I miss the laughing
But not so much you

One step forward
One step forward
One step forward
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back

Standing on the floor, facing you
I can't see you, your impermanence
This place is empty
Empty of you

And if I see you, it's like nothing went wrong
Yeah, if we meet again tomorrow
It's just like nothing went wrong
But there I go
Erasing our chances
Just by asking
"How do you sleep?"
(One step forward
One step forward
One step forward)

And six steps back
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back
And six steps back

Code

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.offsetbox import OffsetImage, AnnotationBbox

def plot_images(x, y, image, ax=None):
    ax = ax or plt.gca()

    for xi, yi in zip(x,y):
        im = OffsetImage(image, zoom=72/ax.figure.dpi)
        im.image.axes = ax

        ab = AnnotationBbox(im, (xi,yi), frameon=False, pad=0.0)


        ax.add_artist(ab)
    # Make the background black
    ax.set_facecolor('black')
    ax.spines['bottom'].set_color('white')
    ax.spines['top'].set_color('white')
    ax.spines['right'].set_color('white')
    ax.spines['left'].set_color('white')
    ax.yaxis.label.set_color('white')
    ax.xaxis.label.set_color('white')
    ax.tick_params(axis='x', colors='white')
    ax.tick_params(axis='y', colors='white')
    
path = "/tmp/james.png"
image = plt.imread(path)
 
lines = open('/tmp/sleep.txt','r').readlines()
steps = []

for line in lines:
    if 'forward' in line.lower():
        steps.append(1)
    if 'back' in line.lower():
        steps.append(-6)
steps_sum = np.cumsum(steps)

fix, ax = plt.subplots(facecolor='black',)
ax.plot(steps_sum, color='white', linewidth=2)
ax.text(0.0, 1.0, "JAMES SLOWLY WALKS AWAY FROM THE WATER", transform=ax.transAxes,
        ha="left", va="bottom", color="w",
        family="sans-serif", fontweight="bold", fontsize=16)


plot_images(range(len(steps_sum)), steps_sum, image, ax=ax)
# plt.title('James Murphy Slowly Walks Away From the Ocean')
plt.xlabel('Time? I guess?',color='white', fontsize=12, fontweight='bold')
plt.ylabel('Distance from Shore (steps)',color='white', fontsize=12, fontweight='bold')
plt.show()

steps