Lucas knew full well the importance not just of sound design, especially for a fantasy film like Star Wars, but of the score. Film history is filled with iconic, instantly recognizable scores, the likes of Lawrence of Arabia and The Godfather, but in the realm of science fiction, when there was budget for an original score — the Flash Gordon serial which inspired Star Wars used a cue from The Bride of Frankenstein as its main title for instance — it was either theremins as far as the eye can see, popularized by The Day The Earth Stood Still, or something akin to the 'electronic tonalities' of Forbidden Planet. Even The Planet of the Apes, the only big franchise in science fiction at the time, had a brilliant and innovative score by Jerry Goldsmith, but recognizable though it was (and revolutionary in its own right) it was far from the romantic grandiosity that Williams would bring to Star Wars. Stanley Kubrick's 2001: A Space Odyssey had moments of ballet-like scenes accompanied and indeed carried by the sweeping classical music by Johann Strauss, but that was about the extent of it.
In fact, the music that was closest to the kind Williams would go on to make for Star Wars was that of golden age movie composers like Erich Wolfgang Korngold, Max Steiner, Franz Waxman and Hitchcock-stalwart Bernard Herrmann (that latter two with whom Williams had worked as a pianist in his younger days). These were the composers behind the music for the kinds of adventure films that Lucas drew so much of the frantic action and princess-dashing hero mechanics from in the first place.
Much like the film itself, the score is inspired by a cross-section of those kinds of existing sources, often quite blatantly so — its genius being in how it integrates the many small hints and borrowings into a greater weave of leitmotifs and themes — as well as some more eclectic selections, although given the films history in general, it should perhaps come as no surprise.
What is surprising is how it continually mixes styles and themes freely to fit the locations and characters on-screen in a way few mainstream scores before or since have dared to do. While it’s remembered mostly for its sweeping romantic themes, those are interspersed with a range of almost experimental snippets of music which, through the skills of Williams as a composer and conductor, sound completely integral to the score as a whole, but which taken on their own are quite remarkable.
To begin with, the opening Main Titles are reminiscent of the kinds of rip-roaring openings Eric Wolfgang Korngold wrote for a number of adventure films, including The Sea Hawk (1940) and Kings Row (1942), which in turn was probably imitated by Miklós Rózsa for the opening of 1952's Ivanhoe. It’s exactly the kind of ‘big declamatory thing’ Williams described Lucas wanting for Star Wars, and follows the exact same pattern of repeating the A melody twice, segueing into a B melody, before going back into the A melody and finally petering out out into a finality segment and a loose melody exactly the way Main Titles did back in the day.
Kings Row in particular seems an apt predecessor for the Main Titles, with the first few notes being nearly identical. As it happens, Howard Hawks's Air Force, another film Star Wars draws heavily from, also opens with a score in much the same manner.
The following video draws together a number of sources of inspiration, from different pieces of music to the crawl and its treatment, to the opening shot, all of which converge into one of the most iconic pieces of cinema ever made.