As a child, he showed promise as a violinist and he later spent a short time in that role for the local orchestra in Berne.
Although he retained his enjoyment of playing for many years, by early adulthood he was a professional artist, travelling around Western Europe. Much of his art was nevertheless still inspired by Klee's musical preferences.
Klee preferred classical composers such as Mozart and J. S. Bach to more modern exponents of the art – he was particularly taken by Bach's Fugue in E Minor – and this was reflected in his artworks.
His 1919 composition In the Style of Bach makes this connection explicit: the symbols and plants shown in the picture are arranged to recall musical notation and the whole work has similarities with a musical score. The painting's linearity and rhythmic quality that recalls Bach's own mastery of counterpoint.
When Klee gave talks to students at the Bauhaus, he often included musical references, especially where these demonstrated the mathematics inherent in classical music.
In 1924, he painted Cooling in a Garden of the Torrid Zone, another piece which recalls a musical score. In this case, however, the link is even more explicit, with musical staves being represented by strong horizontal line and the plants of the garden arranged as if they were notes.
The whole work looks, at first glance, almost like a piece of manuscript from early modern times.
Even some of Klee's more conventional paintings are directly inspired by particular pieces of music. A good example is Hoffmanesque Fairy Tale Scene, which shows an interpretation of the fantasy characters from The Tales of Hoffman by Jacques Offenbach, an opera Klee particularly enjoyed.
Another work with operatic origins is his watercolour The Bavarian Don Giovanni of 1919, which contrasts the oddity of the hat worn by the figure at the bottom with the simplicity of the painting's overall appearance.
Klee referred to this dualism as a way of fusing artistic and musical influences into "a complimentary whole".
The connection between Klee's musical influences and his paintings is at its most explicit in the large number of his works which include musical terms in their titles.
Among the best known of these is Polyphony (1932), which makes striking use of blocks of colour to allude to bass chords in a piece of music. The painting is then overlaid with thousands of tiny, coloured dots – this is another reference to the Bach-like counterpoint that Klee admired. He was firmly of the opinion that traditional classical music was the pinnacle: although he was an acquaintance of Arnold Schönberg, he apparently never attended one of his Bauhaus productions.