There is a field of study and creation called Visual Music. Its focus is on creating visual expressions of musical structures. William Moritz, a historian of the form writes:
Since ancient times artists have longed to create with moving lights a music for the eye comparable to the effects of sound for the ear.
He offers a very interesting, if slightly dated, examination of the field in this text from 1986.
Visual Music is a somewhat loose term used to describe a fairly wide range of practices. Most early Visual Music experiment can be described as colour organs. Colour organs are devices that were intended to accompany music with synchronized projections of coloured light, often controlled by something resembling a musical keyboard. These have been around in various forms for almost 300 years, starting with Louis-Bertrand Castel's ocular harpsichord of 1730. Castel's device related each note of the octave to a colour, with lighter variations of the tones for higher octaves and darker ones for lower octaves. Some composers (for example Alexander Scriabin) associated specific colours to each musical key rather than each musical note in the octave. Scriabin's arrangement was based on the so-called circle of fifths, so that colours closely related in the colour spectrum were progressively assigned to keys one perfect fifth apart because the fifth is the most consonant harmonic relationship outside of an octave.
It appears that in this sort of scenario, the colours were intended to reflect the harmonic character of the music. According to James Peel:
In the late nineteenth century, there was a resurgence of interest in color-music organs, which appealed to the Romantic aestheticians' search for the universal principles of color harmony. Color, it was hoped, would strike the sensitive viewer at an emotional rather than intellectual level.
(see The Scale and the Spectrum for more about colour organs)
The emergence of film and animation technologies in the early 20th century made it possible to produce animations which involved more than just fluctuating colour fields. The most notable early visual music animator was Oskar Fischinger. His works seem to focus more on the gestural and rhythmic qualities of the music. Another pioneer was Mary Ellen Bute who put her intentions up front with this title at the start of her work Synchromy No2 (1936):
The following film is designed by a modern artist to create moods through the eye as music created moods through the ear
continuing this trend of attempting to appeal to the emotions visually.
John Whitney senior is another pioneer in Visual Music. Working initially with conventional animation, then mechanized animation systems involving pendulums and mirrors, then analogue computers and finally digital systems, Whitney created complex geometric accompaniments to music. For an example of his work, see Arabesque:
He wrote a text called Digital Harmony summing up his experiences and insights about Visual Music. While he did generally include sound in his animations and present a strong sense of complementarity between the sound and image, in part his vision was directed towards a pure visual form with with the fluid expressiveness of music".
There are two distinct streams of Visual Music: that which is intended to as a synchronized accompaniment to music, and that this is intended to stand on its own as a visual presentation of experiences more often connected to the aesthetics of sound and music. The works intended as visual accompaniments in general highlight and augment the music, but in no sense are intended to replace the music. They focus on the notion of complementarity between the sound and image. Many aspects of the musical experience are ignored. Those that stand alone are also not designed to communicate a particular musical work, but rather to present an experience akin to a musical one in visual terms. The field can also be divided into those works that function on scientific and mathematical principles, and those that are very subjective representations on the artist's experience of the music. Much of the structural and experiential underpinnings of music are based on mathematical relationships. Certain Mary Ellen Bute's work is of the highly subjective sort. John Whitney senior is more in the mathematical camp.
Advances in computer technology have meant that most recent work in this field involves systems that directly translate sound or compositional data into visual in real-time or are played improvisationally in conjunction with live or recorded music (in the case of VJs (video equivalent of DJ or disc jockeys)).