IN MUSIC, "close encounters" could be a synonym for intervals - the distances, small or large, that exist between notes. If you want to hear the closet encounter you can play on your piano, play a white note together with the black note right next to it. The interval is a half-step. You can't get any closer than that on a key-board instrument.

In his score for the movie "Close Encounters of the Third Kind." John Williams has used a simple musical theme as the essential ingredient in establishing communication between his principals on earth - from Muncie, Ind.; France; or Wyoming - and the creatures who appear in such fascinating and spectacular space craft to hover near the earth until they receive the critical signal.

That theme is clearly spelled out, in the final scene when the most gorgeous of the visitors' spaceships is hovering over the landing area. An earthling at a synthesizer console, who with musical tones will attempt the crucial face-to-face communication with the aliens, receives his orders.

Play a D.

Now up a whole note

Now down a third

Now down an octave

Now up a perfect fifth.

The result is the sequence D, E, C, C, G. You hear it from various sources: in the electronic tones of a modern synthesizer, from a rapid-fire oboe, and triumphantly returned from the visitors' craft in the deep, rich sound of a tuba, or the raucous blasts of an entire orchestral horn section:

At one point the communications director is ordered to play the sequence faster and faster. The overlapping, as many voices join in, produces a harmony with strong overtones of Richard Strauss or Mahler.

Williams, who is remembered for his scores for "Jaws," "Towering Inferno" and "Star Wars," has, in the sequence D, E, C, G in "Close Encounters" built, consciously or out of his musical subconscious, a fascinating parallel with two other melodies constructed on precisely the same arrangement of notes.

The "Close Encounters" theme frequently recalls the music of Richard Strauss, and in fact, the opening phrase of the trio from the last scence of "Der Rosenkavalier" begins with the same sequence of notes:

Coupled with the Straussian texture, this suggests that Williams, like many other music lovers, has a special fondness for the great opera composer. But the other parallel melody carries a chilling thought. In Franz Schubert's magnificent setting of the Goethe poem, "Der Erlkoenig," this phrase occurs:

The words to which it is sung are "Du liebes Kind, komm geh mit mir." That line translates, "You dearest child, come, go with me." Since one of the earthlings who disappears during the film and later emerges from the big space ship is young Barry Guiler, who looks about 4 or 5 years old, it makes you wonder more than a little if Williams was inspired, or simply touched with a brilliant coincidence.

Early in the film we learn that the musical system through which this communication is to be established is the use of a technique taught by the Kodaly system. This is a method devised by the late Hungarian composer, Zoltan Kodaly, whereby very young children are taught the fundamentals of music.

Still another musical guidepost crops up during the movie. At numerous moments of danger, the score quotes directly the first four notes of the centuries-old Gregorian melody of the "Dies Irae":

This is a theme used repeatedly by masters of the romantic 19th century - Berlioz, Liszt, Rachmaninov and hosts of others. With its reference to the "day of wrath," it is one of the standard signals of ominous portents.

The climatic scene of "Close Encounters" offers still another indication of musical awareness, with the direction for the man at the communications console to "Play a perfect fifth."

The direction is obviously right on the nose, since with all that highly advanced equipment, an imperfect fifth could just as easily be produced. Some early viewers of the movie, having heard the call for a "perfect" fifth, asked what other kinds there might be. There is also a diminished fifth, one in which the interval is reduced by a half-tone, and an augmented fifth, one in which the interval is increased by a half-tone.

Space travel and musci, in fact, both have a sold physical basis. In discussing intervals, the Harvard Dictionary points out: "The following explanation presupposes some knowledge of algebra, including powers, roots, and (optionally) logarithms." It then proceeds to enlighten the curious: "The interval between two tones is determined by the quotient or ratio (not the difference.)" For example, "If frequency of a tones is n, the fifth is 33/82n . . ."

See how easily the director, had he so desired, could have called for an imperfect fifth rather than a perfect fifth?

But something in the "Close Encounters" theme began to nag at me during the movie. Suddenly I remembered Gian Carlo Menotti's friendly takeoff on electronic music and space creatures in his opera, "Help, Help, The Globolinks!" written in 1968.

In the opening scene of that opera, a loudspeaker warns all those within hearing distance:

"Attention, Attention! Unknown flying objects from another planet and strange, dangerous creatures identified so far only as Globolinks, have landed on Earth." A few moments later, the voice continues, "We repeat our last bulletin. Groups of dangerous Globolinks have invaded various parts of the country. No weapon so far has proved effective against them, except the sound of music to which they seem to be extremely allergic. Therefore if you are lucky enough to be able to play an instrument, we advise you . . ."

In Menotti's opera, music is the sole protection against the creatures from outer space. In Steven Spielberg's film, music is the sole means of communicating with the voyagers inside the space craft.

Once again there is a striking parallel, out of sheer coincidence, between the melody with which Menotti's principals repel the invading Globolinks and the theme with which John Williams clinches the deal with the creatures from outer space in "Close Encounters."

Here again, the C.E. theme:

And here Manotti's musical device:

No conclusions can be drawn from any of this, other than the fact that the notes E, C, G, form the most basic relationship in music, that of the mediant, the tonic and the dominant. These make up the tonic triad, which establishes the tonality of any composition written in a tonal system. These three notes can be found in thousands of compositions. They happen to appear in identical sequences in "Close Encounters," "Der Rosenkavalier" and "Der Erlkoenig," and with only a minor variant, in "Globolinks!"

Coincidence? Or creatures from outer spce?