
It is well known that the classic song When You Wish Upon a Star appears several times in the film Close Encounters of the Third Kind, and mostly in the score composed by John Williams:
- Fairly early in the film a Pinocchio music box plays a bar or two of the song.
- In the finale of the film score (referring to Close Encounters of the Third Kind: The Collector's Edition Soundtrack), we hear a statement of the melody using long note values, which serves to slightly obscure it (2:52 in The Visitors / Bye / End Titles).
- There follows a second statement, also using long note values (3:47 in The Visitors / Bye / End Titles).
- These culminate in a literal statement of the When You Wish head motive (4:31 in The Visitors / Bye / End Titles).
- Finally, during the ending credits Williams launches into a full-blown rendition of the song (10:19 in The Visitors / Bye / End Titles).
Beyond these direct statements, John Williams has said that his score for the film is imbued with the essence or feeling of When You Wish Upon a Star. This article will delve into exactly how he did that, and we’ll begin by examining some key aspects of that melody.
Note: I do not own a printed score for Close Encounters and the musical examples in this article were transcribed by ear, so I cannot guarantee accuracy. The simple transcriptions below are intended only as general illustrations.
Key Musical Aspects of When You Wish Upon a Star
The A melody of When You Wish has several musical features that Williams draws upon throughout his score for Close Encounters:
- Octave leaps: there are two leaps of an octave, one very saliently at the beginning. In both places, the octave leap is followed by three notes outlining a third.
- Chromaticism: chromatic inflections in two places, which produce a tugging, yearning effect. The chromatic notes are also accented on downbeats.
- Stepwise descending figure: an eight-note figure descending stepwise through an octave.
- Leaps of a seventh and a sixth: the final two bars of the A melody contain both a leap of a seventh followed immediately by a leap of a sixth.

The B melody also has distinctive characteristics that very directly inform Williams’ score:
- Chromaticism: there are three chromatic inflections that continue and intensify the feeling of yearning. There is, in fact, a rising stepwise chromatic 4-note line (F#-G-G#-A) in the middle of the B melody.
- Quarter note rests on downbeats: two bars have an unexpected rest on a downbeat, which gives the following notes a slight urgency as they ascend to an accented chromaticism.

When You Wish in the Main Theme of Close Encounters
Most of us are very familiar with the iconic five-note main theme of Close Encounters. While it is used throughout the score, it is distinctively featured in the scene when the military team is attempting to communicate musically with the aliens, and then again as a resounding brass fanfare in the finale of the film:

This main theme is a variation of the first bar of When You Wish, in that both are constructed of an octave leap and three notes outlining a third. The variation in Close Encounters is sort of a retrograde inversion of the head motive of When You Wish, illustrated below:

When You Wish in the “Wonder Theme” of Close Encounters
Another theme in Close Encounters which is heard repeatedly throughout the film is what I call the “wonder theme”. For example, we hear this theme:
- When the people gathered on the hillside are gazing with wonder at what they think are approaching UFOs (1:18 in False Alarm).
- When Roy and Gillian finally make it to the site of Devil’s Tower, scrambling up a hill to get their first view of the mountain (0:00 and 0:38 in The Mountain).
- Repeatedly throughout the scene when Roy and Gillian escape from the military camp (beginning at 1:10 in The Escape).
- When Roy and Gillian finally make it to the military landing site (1:51 in Outstretch Hands).
- After the alien mothership has finally descended and people at the landing strip are watching awestruck (3:21 and 3:38 in The Mothership).
- After Roy has been taken inside the mothership and, again, the spectators are filled with awe and wonder (7:10 in The Visitors / Bye / End Titles).
This wonder theme comes close to being a direct quote from When You Wish, departing motivically in the first bar only by the size of the leap (4th versus 3rd). The third bar has a rest on the downbeat, just like When You Wish. Williams then diverges musically in the fourth bar:

It is worth noting that even though the fourth bar of William’s version is different from the original, it still contains a reference to the When You Wish A melody with the leap of a seventh.
A key difference with Williams’ variation is that usually the three notes of the first bar function as scale degrees 6, 7 and 3, whereas in When You Wish they function as scale degrees 2, 3 and 5.
Williams often uses the following variation, which adds a whole step to the head motive:

He also constructs continuous ascending figures using either the head motive of the Close Encounters wonder theme and/or ascending inversions of the stepwise figure from the When You Wish A melody, with several variants:
- As a direct inversion of the stepwise motif, an ascending stepwise figure when the team is investigating the navy planes that have appeared in the desert (0:10 in Navy Planes).
- When the people gathered on the hillside are gazing with wonder at what they think are approaching UFOs, an ascending figure constructed out of two variants of the wonder theme (1:07 in False Alarm).
- When Roy is trying to climb the final stretch up the mountain, constructed from the wonder theme and the ascending stepwise figure (1:20 in Outstretch Hands).

Other Uses of When You Wish in Close Encounters
Stepwise Descending Theme
Williams uses variations of the stepwise descending figure (noted above) several times throughout the finale of the film. These are rarely literal quotes from When You Wish, often more chromatic and/or containing steps of a third, but still derived, I believe, from that stepwise descending figure:
- 2:24 in The Returnees
- 2:03 in The Visitors / Bye / End Titles
- 3:30 in The Visitors / Bye / End Titles
- 9:52 in The Visitors / Bye / End Titles (see below for notation)
Leaping Theme
During the finale of Close Encounters, when the larger alien finally appears and communicates with the humans, there are two statements of an achingly beautiful melody constructed from two essential aspects of When You Wish:
- Leaps: This melody is composed mostly of large leaps of sixths, sevenths and octaves (from the When You Wish A melody), plus leaps of a ninth and a tenth. (Those latter two intervals appear again; see below.)
- Chromaticism: The melody is highly chromatic, so that the entire melody conveys a pang of emotion. Additionally, the lower harmonizing voices express rising stepwise chromatic 4- or 5-note lines, similar to the When You Wish B melody.
I’ll call this the “When You Wish synthesis theme” since it seems to synthesize several aspects of the original song. The first statement of this synthesis theme (5:36 in The Visitors / Bye / End Titles) resolves into a statement of the main Close Encounters theme:

The second appearance of the synthesis theme (6:48 in The Visitors / Bye / End Titles) ends on a fermata, then goes into a moving statement of the wonder theme. However, Williams develops this into a beautiful climax by having the melody rise upward by…a ninth and then a tenth:

Later in the finale (9:37 in The Visitors / Bye / End Titles), we again hear that same climax, this time with a denouement using…the stepwise descending figure, this time literally stepwise and diatonic (as in When You Wish) but in mostly eighth notes:

Conclusion
I hope I’ve succeeded in showing how John Williams managed to suffuse the music of Close Encounters with the sound and/or feeling of When You Wish Upon a Star while using few direct quotations from the song. Close Encounters of the Third Kind is among my very favorite of Williams’s scores; it is beautiful and, at times, transcendent, and a big part of that is the inspiration he drew from When You Wish.
More Musical Analysis
Vader Variations: How the Imperial March is Varied Throughout Star Wars examines some of the less obvious ways John Williams used the Imperial March throughout his scores for the Star Wars movies.
Vertigo's Deeper Connections to Tristan und Isolde explores how composer Bernard Herrmann drew inspiration from the Wagner's opera Tristan und Isolde, while directly quoting Wagner’s music only minimally in his score for the movie Vertigo.