When was it recorded? Jul. 24-29, 1969
When was it first released, and on which album? Sept. 26, 1969 on “Abbey Road”
Who wrote it? Lennon
Have I heard this song before? Yes
What my research dug up:
According to the Beatles Bible, “Sun King” allegedly came to John in a dream. The title probably came from Nancy Mitford’s 1966 biography of the French King Louis XIV, The Sun King, though. Part of the guitar crossfade can also be traced to British-American rock band Fleetwood Mac.
“At the time, ‘Albatross’ was out, with all the reverb on guitar. So we said, ‘Let’s be Fleetwood Mac doing “Albatross,” just to get going.’ It never really sounded like Fleetwood Mac… but that was the point of origin.” — George Harrison
As Alan Pollack wrote in his Notes On series, “‘Sun King’ also amply demonstrates John’s often ingenious approach to form. The track is built up from a small number of short phrases or sections that are flexibly repeated and sequenced in the manner mosaic tiles.”
Pollack also examined the lyrics, which, as the Beatles Bible wrote, “[descend] into cod-Spanish, Italian and Portuguese nonsense, with the odd English phrase thrown in.”
“In the end I am struck by just how smooth and appropriate the lyrics sound in context. On the flippant level, I might say it’s like what Henry Higgins (of ‘Pygmalion’/’My Fair Lady’) said about how ‘the French don’t really care what they say as long as they pronounce it properly.’ But I can restate the same comment to observe with more serious irony that for the listener who understands neither Spanish nor Italian, the question of whether or not the words make sense in literal or even figurative translation is moot and meaningless. John’s fortuitous grasp of some of the rhythm of the two languages, the lilt of their vowel sounds, and even a couple of real vocabulary words thrown in for good measure, works just as well; even if it doesn’t really make ‘sense.’ Because (and here’s the kicker) in the context of a song like this, ‘making sense’ per se is much less important than sounding convincingly as though you do.”
The Beatles began recording the song under the title (I kid you not) “Here Comes the Sun-King.” Obviously, with George’s “Here Comes the Sun” already appearing on the album, the title was truncated to just “Sun King.”
“Sun King” was recorded as one with “Mean Mr. Mustard” (Day 166). On Jul. 24, 1969, the Beatles recorded 35 rhythm track takes. The band overdubbed vocals, piano and an organ part played by George Martin the following day. They added more of all those effects (plus more percussion) on Jul. 29 and called it a record.
Quoth Wikipedia, “Another noted aspect of the song is its use of cross-channel phasing, or stereo panning and fading. The lead guitar line slowly moves from the right to left channel and then back. This occurs in the beginning of the song, and then again at the end.”