Katy Perry may have captured the world’s attention with her enormous eyeballs, but as I argued earlier this week, the reason “Teenage Dream” went to No. 1 and remains in radio rotation is that it is a textbook example of the excellence and supremacy of the rules of Western music theory.

Today, with a hat tip to Rick Moody and Dean Wareham, we’ll continue this not-boring exercise with Daft Punk’s hit, “Get Lucky.”

First off, we should address this song’s repetitiousness. There’s a delicious middle finger extended here, beyond the fact that the four-chord loop never alters: Pharrell’s vocal performances, and Nile’s guitar parts, are photocopied. The pre-choruses, the choruses, they are exactly identical, copy-pasted in GarageBand. It’s not even evident that Daft Punk asked its guests to do complete takes. This isn’t innovative, but it is egregious, a punkish move, sending a clear message: “This Is Pop, Where Repetition Is King, And Our Time Is More Valuable Than Yours.”

For this reason, it is not surprising that Moody is frustrated by “Get Lucky.” This sort of copypasta isn’t exactly recommended by Walter Piston. It’s almost as if Daft Punk is baiting the musically knowledgeable people in the room to pull a poo-face and retire to their dorm rooms to practice their Mendelssohn. Us nerds, we have gone home, you lot can keep on dancing.

Another interesting feature about this endlessly repeating four-chord progression: This song has an ambiguous tonality. “Teenage Dream” denied the listeners the I chord to create weightlessness; in “Get Lucky,” it is aurally unclear what the I chord even is!

See, the song can be heard in two different keys. Most of the time it sounds as if it’s in the minor mode of A Aeolian*—the scale goes A B C D E F G—essentially, a form of A minor, which appears as the third of the four chords (“We’re up all night for good fun”).

But the first chord of the progression isn’t A minor, it’s D minor. The song slides smoothly back to it each time (“I’m up all night to get some”). The insistence of the D minor creates the aural illusion that the song could in fact be in the minor mode of D Dorian—D E F G A B C. Note that the D Dorian scale contains all the same notes as A Aeolian, all the same keys on the piano. The only difference is what key you start on.

So, when the chord cycle comes back around to the beginning, the D minor, each time, the ear is tricked for a moment into thinking that the song is in a different key, a musical Tilt-a-Whirl. I am not going to lie: To my ears the song is clearly identifiable as A minor, but on a Kinsey scale, I’d rate it a 3.

This Tilt-a-Whirl ambiguity is easy for the ear to discern and also easy to describe even without any musical background. Even untrained music writers typically will use the word “cyclical” or “spiraling” to describe this type of ambiguous progression. Two other songs with famously ambiguous key centers are Radiohead’s “Pyramid Song” and Public Image Ltd’s “Poptones.” Do some rigorous Googling and you’ll find that listeners are aware of the sensation, even if they don’t describe the mechanical specifics.

Third observation: Daft Punk pulls off a classic move in this song during the bridge, at that moment when the chorus of robots breaks it down. The move? They overlay the hook from the pre-chorus with the hook from the chorus, getting them both going simultaneously. This is not an original device, but a classic one in the world of Western music theory, subject and countersubject. Two melodies that live separately but will join together in a climax of ecstatic melodic copulation.

Below is a transcription of the hook (robots) and pre-chorus (Pharrell). See how elegantly the rhythms counterbalance each other! One is busy and syncopated and repetitious, the other is straight and simple and has a nice long arc to it. And yet they’re both such strong hooks on their own! If these four bars appeared on a counterpoint exam, it would get impressive marks.

For extra credit, for motet lovers, I did my best to simplify these melodies to fifth species on staves 3 and 4 for easier visual analysis. It’s not textbook perfect, but even Jeppesen would begrudgingly give this example a passing grade. (Deductions for an open fourth, two unresolved seconds, and for repetitiousness of material? 6/10).

I’d love to make mention of some other hit singles that climax with a coupling of vocal hooks, but scanning through the past 10 years of Billboard’s No. 1s, I’m drawing blanks. Fiona Apple’s “Hot Knife” is an example that springs to mind, and a weaker almost-example is Bill Withers “Lean On Me”—but I hope you fare better than me in the comments.

Wrapping up, I’d like to point out a key idiosyncrasy in the text setting of “Get Lucky.” This English-language song, written by French speakers, shares an identical beauty mark with another well-known French confection: Phoenix’s “If I Ever Feel Better.” Already “Get Lucky” sounds like vintage Phoenix—largely because Phoenix’s fabulous first album cribs so heavily from Nile Rodgers—but let me draw your attention to the irresistible abuse of the word good: “We’re up all night for good fun” vs. “Remind me to spend some good time with you.”

First, this is a specifically Francophonic idiosyncrasy; native English speakers do not ask their lovers to remind them to spend “good time” with them, nor do they identify “good fun” as their motivation for staying up all night.

Secondly, the weighting is all wrong. Good is a word that needs to fall heavy, needs to be placed at the beginnings and endings of phrases. Remember Sir Paul McCartney’s placement of good in “Good Day, Sunshine”—always settling on heavy syllables. “GOOD day SUNshine.” “I’m looking GOOD, you know she’s LOOKing fine.” Worlds away from its apostrophic weighting in “WE’RE up all night for good FUN.” For Daft Punk and Phoenix this little bit of language mangling works in their favor. It sounds off-balance and playful and sexy, like a foreign exchange student who might be a little drunk.

Thanks for reading.

*N.B. this song is actually in F# Aeolian, not A Aeolian, but for casual readers, I stuck with the white keys. Also, I deliberately omitted mentions of added-7’s in my chord descriptions because of an inconsistency in notational unity between classiclers and jazzers, omitted also for irrelevance.