I had the pleasure and privilege of conducting Haydn's Symphony No 80 in D minor in Salzburg recently. It's an astonishing work, full of surprises, and almost completely unknown. The first movement is typically Sturm und Drang until the exposition is suddenly interrupted by a charming and elegant dance-like theme. In the development section, Haydn introduces unusually long pauses and, with daring modulations, makes unexpected excursions into strange tonalities. The last movement - the Presto - is a tour de force of rhythmic ambiguities: the listener has to guess where the upbeats and the downbeats are; only after 32 bars does Haydn introduce rhythmic regularity. It's ingenious, and extremely funny. But in Salzburg no one laughed. No one even smiled. It seems to be much easier to make an audience cry than it is to make them laugh. There are many music-lovers who won't even admit that humour has a place in what we call classical music. These are people who have no difficulty recognising sadness, tragedy, grief, majesty and grandeur - because these are serious attributes, and they want their beloved music to be "serious". For them jokes are made of cheap, vulgar and inferior matter that cannot be tolerated on the altar of High Art.

Several years ago in a Tokyo bookstore I came upon a strange book in which the author explained how to understand jokes. Each joke or anecdote was followed by several pages of instructions telling the reader why it was supposed to be funny.

Haydn was writing for a public that understood perfectly his musical language. In Eisenstadt and Esterháza, in Vienna and Paris, and first and foremost in London, he was surrounded by a small but knowledgeable circle of professional and amateur musicians who received each new work with interest and appreciation. His audience was familiar with his earlier compositions, they knew his personal style and recognised immediately the unusual features of a new symphony. Musical expectations and surprises did not have to be explained, and Haydn's humour was able to flourish. Today's listening community is of course very different, and all too often we feel the need of a "Japanese booklet" to enlighten certain members of the audience.

Haydn's keyboard works are full of delicious surprises. Take his early Capriccio in G major, which takes as its theme the folk song Acht Sauschneider Müssen Sein. The text of this song is a humorous one: it describes castrating a pig, an operation for which no fewer than eight expert butchers were needed. Haydn translates this into musical terms by wandering wildly from one key to the next, presenting the main theme in its entirety or in fragmented form through various registers of the instrument. There is nothing conventional about this piece, nothing that would have met listeners' expectations. The C major Fantasy (Capriccio) was written almost a quarter of a century later, in 1789. Compared to its predecessor, this is a mature masterpiece, a curious mixture of sonata and rondo forms. On two occasions - on a pause over an octave in the bass - the music comes to a standstill. Here the composer instructs the player to "Tenuto intanto, finché non si sente più il suono" - hold until the sound is not heard any more. Even on a period instrument this pause feels painfully long - the audience begins to get worried - has the poor pianist had a memory lapse? But suddenly the bass quietly slides a semitone upwards, opening new harmonic territories. It is both hilarious and surprising.

In his last piano sonata in E flat major the majestic opening movement is followed by a noble Adagio in E major. This key change alone feels shocking. Conventions of the time dictated that this second movement should have been in the dominant key - B flat major, or in C minor, the parallel minor. The juxtaposition of E flat major and E major was very daring. No composer before Haydn had had the nerve to be so experimental, although Beethoven, for one, followed his example (his late string quartet Op131 has its first movement in C sharp minor, the second in D major), and Schubert's C major string quintet moves from E major in its second movement to an F minor middle section. Haydn's Adagio ends solemnly in E major. As the piano sonata's final movement begins, the right hand alone plays five repeated quavers on G, and we think we're in E minor. The bass then enters on the tonic, E flat. It feels as if Haydn is telling us: "Wrong again."

His unjustly neglected piano trios are amazing works. The one in E flat minor - who else would have written a piece in this key in the 1790s? - opens with an expressive Andante Cantabile, written in double variation form. The following Allegro (there are only two movements) carries the subtitle "Jacob's dream" (an allusion to Jacob's dream of a ladder stretching up to heaven). According to a contemporary anecdote, the violinist of the trio that gave the first performance was infamously arrogant and vain. The first page of music is fairly simple and can be easily sightread. However, after the page-turn the fiddle part escapes into hair-raising heights, which must have presented the musician with serious difficulties - as well as teaching him a lesson in humility.

Haydn's 104 symphonies are widely admired, although only a handful are regularly performed, and when they are, they are invariably placed at the beginning of programmes. This is a pity. Audiences, at the start of concerts, do not really listen to the music. They need to be warmed up - just as the players do - and so Haydn's wonderful ideas are not fully appreciated. Why don't we hear these symphonies at the end of the programme? Or indeed, what's wrong with concert of nothing but Haydn symphonies?

Take No 60 "Il Distratto", a theatrical masterpiece in six movements where in the middle of the Finale the music simply stops and the violins find they need to retune their instruments. Or the one in D major, no 93, the first of the so-called London symphonies. Its second movement proceeds with tender elegance until the brutal interruption of the bassoons - they feel like the proverbial bull in the china-shop. Even today, such tonal effects still feel comic and naughty.

Haydn was an astounding composer, and humour is only one part of his wonderful art. Whole movements, even entire works, are built from one tiny cell - a compositional technique that the young Beethoven learned from his teacher. His sense of proportion was unerring. In the operas and oratorios he overwhelms us with dramatic force and power. The sacred works, like the late masses and his Seven Last Words, are deeply felt and profoundly moving. In his string quartets, symphonies and piano sonatas, he discovered new horizons. The world needs to appreciate him much more: of all the really great composers, he is still the most underrated.

Let me finish with a joke, not a politically correct one, but one that - I guess - might have amused Joseph Haydn.

On a psychiatric ward the patients are sitting in a circle, telling jokes. The jokes are numbers. "58," says one. The others roll about with laughter. Another one shouts: "63." Hilarity ensues. The chief psychiatrist is jealously observing the proceedings - he wants to join in the fun. "17!" he says. Deadly silence. "What's the matter?" he asks. "Isn't there a joke number 17?" "Of course there is," a patient answers, "but you told it so badly."

• András Schiff performs Haydn piano works at the Wigmore Hall, London, on Sunday, and lectures on Haydn at the same venue at 2pm today. Radio 3's Haydn season launches on Sunday. This is an edited and translated version of an article that appeared in the May edition of Fono Forum.